関数
ItemPage::addWishlistButton( string $skubutton )
商品ページの「カートへ入れる」ボタンの隣にお気に入りリストに追加するボタンを追加する
パラメータ パラメータ
- $skubutton
(文字列) (必須)
ファイル: src/Views/ItemPage/ItemPage.php
public function addWishlistButton($skubutton) {
global $usces;
$display = Master::getFilterableValues();
$currentsku = urlencode($usces->itemsku['code']);
$post_id = (int)get_the_ID();
ob_start();
?>
<div class="wcexwl item-page-buttons flex row-wrap ai-stretch jc-flex-end ml-05rem-children-not-first mt-05rem-children">
<?php echo $skubutton; ?>
<div class="wcexwl flex row-wrap ai-stretch">
<input
type="submit"
value="<?php echo $display['addToWishlistButtonText'] ?>"
class="wishlist-button <?php echo $display['btnsecondary']; ?>"
onclick="return wcexwl.item.addToWishlist(event, this, <?php echo $post_id; ?>, '<?php echo $currentsku; ?>')"
/>
</div>
</div>
<?php
$buttons = (string)ob_get_clean();
/**
* Filters item page SKU and wishlist button HTML
*
* @important
* @param string $buttons
* @param string $skubutton Welcart 'Add to Cart' SKU button
* @param int $post_id
* @param string $currentsku
*/
$buttons = apply_filters('wcexwl_filter_item_page_buttons_html', $buttons, $skubutton, $post_id, $currentsku);
return $buttons;
}