ソニーペイメントサービスの2つの決済モジュール

Welcart Beldad 1.4 をリリース

Welcart Beldad 1.4 をリリースしました。主な修正点は以下のとおりです。

PHP8.0の対応

修正内容につきましては該当箇所が多岐に渡る為、ファイル毎に照らし合わせをして修正をお願いいたします

在庫状態が「廃盤」「入荷待ち」でも一覧ページに「売り切れ」と表示される不具合を修正

テンプレート修正 : archive.php 53行目あたり
テンプレート修正 : category.php 82行目あたり
テンプレート修正 : front-page.php 263行目あたり
テンプレート修正 : search.php 49行目あたり
テンプレート修正 : wc_templates/wc_search_page.php 79行目あたり
テンプレート修正 : wc_templates/member/wc_favorite_page.php 75行目あたり
【変更前】
<?php if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) : ?>
    <span class="itemsoldout">
        <span class="text">
            <?php esc_html_e( 'SOLD OUT', 'welcart_basic_beldad' ); ?>
            <?php if ( wcct_get_options( 'display_inquiry' ) ) : ?>
                <span class="sub_text"><?php wcct_options( 'display_inquiry_text' ); ?></span>
            <?php endif; ?>
【変更後】
<?php if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) : ?>
    <span class="itemsoldout">
        <span class="text">
            <?php welcart_basic_soldout_label( get_the_ID() ); ?>
            <?php if ( wcct_get_options( 'display_inquiry' ) ) : ?>
                <span class="sub_text"><?php wcct_options( 'display_inquiry_text' ); ?></span>
            <?php endif; ?>

※ welcart_basic_soldout_label( get_the_ID() ) に書き換え


テンプレート修正 : inc/front-customized.php 65行目あたり
<div class="inner cf">

    <?php
    
    $pictid = $usces->get_subpictid( usces_the_itemSku( 'return' ) );
    if ( $pictid ) {
        ?>

※ global $usces; を削除


テンプレート修正 : inc/front-customized.php 554行目あたり
【変更前】
 * Usces_assistance_item
 */
function wcct_assistance_item_list( $list, $post ) {
global $usces;

$post_id = $post->ID;

$str  = '<li class="list">';
$str .= '<div class="itemimg">';
$str .= '<a href="' . get_permalink() . '" rel="bookmark" title="' . wp_filter_nohtml_kses( get_the_title() ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' ) . '';
if ( ! usces_have_zaiko_anyone( $post_id ) ) {
    $skus = $usces->get_skus( $post_id );
    $num  = $skus[0]['stock'];
    $str .= '<span class="itemsoldout"><span class="text">' . __( 'SOLD OUT', 'welcart_basic_beldad' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $str .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    }
【変更後】
 * Usces_assistance_item
 */
function wcct_assistance_item_list( $list, $post ) {
$post_id = $post->ID;

$str  = '<li class="list">';
$str .= '<div class="itemimg">';
$str .= '<a href="' . get_permalink() . '" rel="bookmark" title="' . wp_filter_nohtml_kses( get_the_title() ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' ) . '';
if ( ! usces_have_zaiko_anyone( $post_id ) ) {
    $str .= '<span class="itemsoldout"><span class="text">';
    $str .= welcart_basic_soldout_label( $post_id, 'return' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $str .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    }

※ 変更前の「global $usces;」を削除
※ 変更後の2行に差し替え


テンプレート修正 : inc/load.php 12行目あたり
require get_stylesheet_directory() . '/inc/front-customized.php';
require get_stylesheet_directory() . '/inc/term-customized.php';
require get_stylesheet_directory() . '/inc/widget-customized.php';
require get_stylesheet_directory() . '/inc/template-functions.php';

※ require get_stylesheet_directory() . ‘/inc/template-functions.php’; を追加


テンプレート追加 : inc/template-functions.php
inc/
   front-customized.php
   load.php
   template-functions.php
   term-customized.php
   theme-customizer.php
   widget-customized.php

※ inc ディレクトリ内に template-functions.php を配置


テンプレート修正 : inc/widget-customized.php 39行目あたり
【変更前】
if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) {
    $html .= '<div class="itemsoldout">' . "\n";
    $html .= '<div class="text">' . "\n";
    $html .= __( 'SOLD OUT', 'welcart_basic_beldad' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $html .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    }
【変更後】
if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) {
    $html .= '<div class="itemsoldout">' . "\n";
    $html .= '<div class="text">' . "\n";
    $html .= welcart_basic_soldout_label( get_the_ID(), 'return' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $html .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    }

※ $html .= welcart_basic_soldout_label( get_the_ID(), ‘return’ ) . “\n”; に差し替え


テンプレート修正 : inc/widget-customized.php 79行目あたり
【変更前】
$list .= get_welcart_basic_campaign_message( $post_id ) . "\n";
$list .= '<a href="' . get_permalink( $post_id ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' ) . "\n";
if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone( $post_id ) ) {
    $skus  = $usces->get_skus( $post_id );
    $num   = $skus[0]['stock'];
    $list .= '<div class="itemsoldout"><div class="text">' . __( 'SOLD OUT', 'welcart_basic_beldad' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    };
【変更後】
$list .= get_welcart_basic_campaign_message( $post_id ) . "\n";
$list .= '<a href="' . get_permalink( $post_id ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' ) . "\n";
if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone( $post_id ) ) {
    $list .= '<div class="itemsoldout"><div class="text">';
    $list .= welcart_basic_soldout_label( $post_id, 'return' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    };

※ 変更後の2行に差し替え


テンプレート修正 : inc/widget-customized.php 120行目あたり
【変更前】
$list .= '<div class="itemimg">' . "\n";
$list .= '<a href="' . get_permalink( $post_id ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' ) . "\n";
if ( ! usces_have_zaiko_anyone( $post_id ) ) {
    $skus  = $usces->get_skus( $post_id );
    $num   = $skus[0]['stock'];
    $list .= '<div class="itemsoldout"><div class="text">' . __( 'SOLD OUT', 'welcart_basic_beldad' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    };
【変更後】
$list .= '<div class="itemimg">' . "\n";
$list .= '<a href="' . get_permalink( $post_id ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' ) . "\n";
if ( ! usces_have_zaiko_anyone( $post_id ) ) {
    $list .= '<div class="itemsoldout"><div class="text">';
    $list .= welcart_basic_soldout_label( $post_id, 'return' ) . "\n";
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
    };

※ 変更後の2行に差し替え

商品詳細ページにアクションフックを追加

フック追加 : wc_templates/wc_item_single.php 126行目あたり
フック追加 : wc_templates/wc_item_single_data.php 145行目あたり
フック追加 : wc_templates/wc_item_single_service.php 124行目あたり
<div class="right">

    <?php usces_the_itemGpExp(); ?>

    <?php do_action( 'usces_theme_item_single_before_options' ); ?>

    <?php if ( usces_is_options() ) : ?>
        <dl class="item-option">
            <?php while ( usces_have_options() ) : ?>

※ do_action( ‘usces_theme_item_single_before_options’ ) を追加