简体   繁体   中英

WooCommerce add to cart button only

So, I am creating a custom shop with Woocommerce where products are on Woo, but single product page is created as a regular page instead of Woocommerces one template. Is there a way for me to insert somehow only add to cart button related to a certain product to any page? I thought of just using [product_page id="X"] shortcode and using CSS display: none; for all elements except for add to cart button, but that is not a good solution...

Hope this will help you. This is the default shortcode in woo commerce to display the add to cart button. This shortcode allows you to show the price and add to cart button of a single product by ID. See the below shortcode.

`array(
 'id' => '99',
 'style' => 'border:4px solid #ccc; padding: 12px;',
 'sku' => 'FOO'
 'style' => 'TRUE'
 'class' => 'CSS-CLASS'

)

[add_to_cart id="99"] `

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM