mercredi 20 janvier 2016

Woocommerce add_to_cart Inline

I'm using the Woocommerce shortcode [add_to_cart id="151" style=""] in order to add a price and Add to Cart button within an existing <p> tag. However, what is appears to be added is a closed </p> tag and the output of the shortcode is wrapped in its own <p> tag which causes the was price, current price and add to cart button onto the next line.

I.e. this is what is outputted today

<div class="wccc-content-block" id="wccc-content-block-166">
    <p>You’ve added enough products.        </p>
    <p class="product woocommerce add_to_cart_inline ">
        <del><span class="amount">£25.00</span></del>
        <ins><span class="amount">£20.00</span></ins>           
        <a rel="nofollow" href="/shop/?add-to-cart=151" data-quantity="1" data-product_id="151" data-product_sku="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart">Add to cart</a>
    </p>
</div>

Is it possible to use a <span> tag instead so the output of the shortcode says within the original <p> tag and therefore inline as intended?

I.e. this is what I'd like to be outputted

<div class="wccc-content-block" id="wccc-content-block-166">
    <p>You’ve added enough products. Get your bonus: 
        <span class="product woocommerce add_to_cart_inline ">
            <del><span class="amount">£25.00</span></del>
            <ins><span class="amount">£20.00</span></ins>           
            <a rel="nofollow" href="/shop/?add-to-cart=151" data-quantity="1" data-product_id="151" data-product_sku="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart">Add to cart</a>
        </span>
    </p>
</div>

Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire