小编Dav*_*nga的帖子

WooCommerce 3 中产品变化的 Ajax 添加到购物车按钮

我这里有这个按钮。此按钮的用途是将产品 id 为 237、变体 id 为 208673、attribute_pa_option 为蓝牙的产品添加到购物车。有没有办法 AJAX 这个?

<div class="btnss">
    <span class="price">
        <span class="woocommerce-Price-amount amount">6,999&nbsp;
            <span class="woocommerce-Price-currencySymbol">kr</span>
        </span>
    </span>
    <div class="quantity buttons_added">
        <input type="button" value="-" class="minus">
        <label class="screen-reader-text" for="quantity_5b101f605f067">Quantity</label>
        <input type="number" id="quantity_5b101f605f067" class="input-text qty text" step="1" min="1" max="" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" aria-labelledby="">
        <input type="button" value="+" class="plus">
    </div>
    <a href="/?add-to-cart=237&variation_id=208673&attribute_pa_option=bluetooth" class="button product_type_simple add_to_cart_button ajax_add_to_cart">Add to cart</a>
</div>
Run Code Online (Sandbox Code Playgroud)

php ajax wordpress jquery woocommerce

6
推荐指数
1
解决办法
9245
查看次数

标签 统计

ajax ×1

jquery ×1

php ×1

woocommerce ×1

wordpress ×1