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

Welcart Voll 1.4 をリリース

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

PHP8.0の対応

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

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

テンプレート修正 : category.php 52行目あたり
テンプレート修正 : front-page.php 174行目あたり
テンプレート修正 : wc_templates/wc_search_page.php 79行目あたり
テンプレート修正 : wc_templates/member/wc_favorite_page.php 76行目あたり
<?php if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) : ?>
    <div class="itemsoldout">
        <div class="text">
            <?php esc_html_e( 'SOLD OUT', 'welcart_basic_voll' ); ?>
            <?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() ) : ?>
    <div class="itemsoldout">
        <div 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 551行目あたり
【変更前】
$html .= '<div class="itemimg"><a href="' . get_permalink( get_the_ID() ) . '">' . usces_the_itemImage( 0, 300, 300, '', 'return' );
$html .= apply_filters( 'usces_filter_theme_favorite_icon', '', 0 );
if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) {
    $html .= '<div class="itemsoldout"><div class="text">' . __( 'SOLD OUT', 'welcart_basic_carina' );
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $html .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>';
    }
【変更後】
$html .= '<div class="itemimg"><a href="' . get_permalink( get_the_ID() ) . '">' . usces_the_itemImage( 0, 300, 300, '', 'return' );
$html .= apply_filters( 'usces_filter_theme_favorite_icon', '', 0 );
if ( wcct_get_options( 'display_soldout' ) && ! usces_have_zaiko_anyone() ) {
    $html .= '<div class="itemsoldout"><div class="text">';
    $html .= welcart_basic_soldout_label( get_the_ID(), 'return' );
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $html .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>';
    }

※ 変更後の2行に書き換え


テンプレート修正 : inc/front-customized.php 658行目あたり
【変更前】
$list .= '<div class="itemimg">';
$list .= '<a href="' . get_permalink( $post_id ) . '">' . 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'];
    $list .= '<div class="itemsoldout"><div class="text">';
    $list .= __( 'SOLD OUT', 'welcart_basic_voll' );
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>';
    };
【変更後】
$list .= '<div class="itemimg">';
$list .= '<a href="' . get_permalink( $post_id ) . '">' . usces_the_itemImage( 0, 300, 300, $post, 'return' );
if ( ! usces_have_zaiko_anyone( $post_id ) ) {
    $list .= '<div class="itemsoldout"><div class="text">';
    $list .= welcart_basic_soldout_label( $post_id, 'return' );
    if ( wcct_get_options( 'display_inquiry' ) ) {
        $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>';
    };

※ 変更後の2行に書き換え


テンプレート修正 : inc/front-customized.php 693行目、699行目あたり
【変更前】
function wcct_filter_featured_widget( $list, $post, $list_index, $instance ) {
    global $usces;
    $post_id = $post->ID;
    $post    = get_post( $post_id );

    $list  = '<div class="inner">' . "\n";
    $list .= wcct_get_produt_tag( $post_id ) . "\n";
    $list .= '<div class="itemimg"><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_voll' ) . "\n";
        if ( wcct_get_options( 'display_inquiry' ) ) {
            $list .= '<span class="sub_text">' . wcct_get_options( 'display_inquiry_text' ) . '</span>' . "\n";
        };
【変更後】
function wcct_filter_featured_widget( $list, $post, $list_index, $instance ) {
    global $usces;
    $post_id = $post->ID;

    $list  = '<div class="inner">' . "\n";
    $list .= wcct_get_produt_tag( $post_id ) . "\n";
    $list .= '<div class="itemimg"><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";
        };

※ $post = get_post( $post_id ); を削除
※ 変更後の2行に書き換え


テンプレート修正 : inc/template-functions.php 28行目あたり
    return $classes;
}
add_filter( 'body_class', 'wcct_body_classes' );

/**
 * Soldout label
 *
 * @param int    $post_id Post ID.
 * @param string $out Return value or echo.
 * @return string|void
 */
function welcart_basic_soldout_label( $post_id, $out = '' ) {
    global $usces;

    $stock_status = __( 'SOLD OUT', 'welcart_basic_voll' );
    $skus         = wel_get_skus( $post_id );
    if ( 1 === count( (array) $skus ) ) {
        $stock = $skus[0]['stock'];
        if ( 2 !== (int) $stock ) {
            $stock_status = $usces->zaiko_status[ $stock ];
        }
    }
    $stock_status = apply_filters( 'welcart_basic_filter_soldout_label', $stock_status, $post_id, $skus );
    if ( 'return' === $out ) {
        return $stock_status;
    } else {
        echo esc_html( $stock_status );
    }
}

※ 上記部分を追加

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

フック追加 : wc_templates/wc_item_single.php 122行目あたり
フック追加 : wc_templates/wc_item_single_data.php 118行目あたり
フック追加 : wc_templates/wc_item_single_service.php 122行目あたり
<div class="right">
    <?php
    usces_the_itemGpExp();

    do_action( 'usces_theme_item_single_before_options' );

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

※ do_action( ‘usces_theme_item_single_before_options’ ); を追加