WooCommerce仅添加到购物车按钮
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...
因此,我正在使用Woocommerce创建一个自定义商店,其中产品位于Woo上,但单个产品页面创建为 常规页面而不是Woocommerces一个模板。 有没有办法让我插入某种方式只添加到某个产品的推车按钮到任何页面? 我想过只使用[product_page id =“X”]短代码并使用CSS display:none; 除了添加到购物车按钮之外的所有元素,但这不是一个好的解决方案...... p> div>
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"] `