admin管理员组文章数量:1301601
My client's website will be selling jewelry. Mostly one of a kind rings. So once a ring is purchased, it's no longer available for sale.
The rings are available in a range of sizes. The size selected does not change the price of the ring. Most rings share the same set of available sizes, but some rings are available in additional sizes.
What's the easiest way I can set this up for my client?
I'd really like to avoid variable products as I believe this is primarily setup for product attributes that affect the price and possibly the appearance of the product. Variable products also require more steps to setup the new product.
I need to be able to choose (on a product by product basis) which values I want to populate a select list on the product page. The size that gets selected then needs to be viewable in the orders page or on the order email.
I'm fairly competent in php and javascript, so if there's some direction given I could possibly roll a custom solution. But perhaps there's a plugin or something that can achieve this?
My client's website will be selling jewelry. Mostly one of a kind rings. So once a ring is purchased, it's no longer available for sale.
The rings are available in a range of sizes. The size selected does not change the price of the ring. Most rings share the same set of available sizes, but some rings are available in additional sizes.
What's the easiest way I can set this up for my client?
I'd really like to avoid variable products as I believe this is primarily setup for product attributes that affect the price and possibly the appearance of the product. Variable products also require more steps to setup the new product.
I need to be able to choose (on a product by product basis) which values I want to populate a select list on the product page. The size that gets selected then needs to be viewable in the orders page or on the order email.
I'm fairly competent in php and javascript, so if there's some direction given I could possibly roll a custom solution. But perhaps there's a plugin or something that can achieve this?
Share Improve this question edited Sep 28, 2018 at 3:45 Joseph Farruggio asked Sep 28, 2018 at 2:26 Joseph FarruggioJoseph Farruggio 131 silver badge4 bronze badges1 Answer
Reset to default 1You can use product attributes. You can configure them in the back-end, and then add something like this to your template:
<?php $sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are available ?>
<span class="product-size-label">Choose your size:</span>
<select class="product-size">
<?php foreach($sizes as $size){ ?>
<option><?php echo $size; ?></option>
<?php } ?>
</select>
<?php } ?>
However, if it affects the price or appearance of your products, you have to use product variations. That's what they were designed for. As far as plugins go, I haven't tried any of them but it looks like there's a few that could achieve that fucntionality, e.g. this one.
本文标签: customizationWooCommerce Simple Product Options List
版权声明:本文标题:customization - WooCommerce Simple Product Options List 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741677885a2391990.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论