Hi All,
I am having an issues with Multi variants and stock quantities in 3.0.10.
How should i set this up?? If I enter 0 quantity on the Parent product it only displays the Notify Me Option even when I have stock of the child products.
If I put a quantity into the parent it is fine (although this then displays incorrect stock QTY on parent), does the parent quantity get updated when someone buys a child product?
Also I am looking to update the child stock quantities via a PHP script on a regular basis which will not update the parent stock quantity.
I think the easiest solution would be to not display "In Stock" on the product page if it is a parent product, once a buyer selects a size, then display quantity available of that size.
I hope this makes sense.
Any ideas / suggestions would be greatly appreciated.
Many thanks
Mark
Hi,
I have the inverted problem, i need to use parent stock for variant(and don't check for child stock).
The product are prints and limited edition. The total autorized edition(stock) is this from parent.
I have other work todo before, but if someone have already a code to verify and change parent stock, this help me.
Thanks,
Patrick
H All,
Could someone please point me in the right to hide stock quantities for parent products.
I m thinking of hiding the "In Stock" for all products with an SKU ending in "-" (all my parent sku's end in -)
I am editing the Product Details template and trying something along the lines of :-
<?php if($show_stock) : ?>
<div class="product-stock-cont col-sm-6">
<?php if substr($this->product->product_sku,-1) = '-'; ?> // this is what im trying to get working
<?php $stock = VPFrameworkVM::getStockText($this->product); ?>
<span class="<?php echo $stock->class ?> hasTooltip" title="<?php echo $stock->tip ?>"><?php echo $stock->text ?> : <?php echo $this->product->product_in_stock ?></span>
</div>
<?php endif; ?>
<?php endif; ?>
Any help would be much appreciated
Many thanks
Mark
<?php if substr($this->product->product_sku,-1) != '-'; ?>
??
<?php if (substr($this->product->product_sku,-1) !== '-' ): ?>
Bracket are missing too. But in all case this is a poor code.
Hi,
I am not a programmer so I would expect it to be poor lol.
It was just to show what I was trying to do.. to hide the stock quantities of parent products on detail pages.
So any help pointing me in the right direction would be much appreciated.
Thanks again
Mark
Sent from my SM-G901F using Tapatalk
Many Thanks Studio 42.
Your code does exactly what is was looking for, may I ask why this is the wrong way to do it?
Looks like i'll be booking myself a PHP course.
Thanks again
Mark
Only my opinion because you need :
Quote(all my parent sku's end in -)
and can give problem when you have to use another sku
I think it's better to check for product parent_id ==0.
Many thanks Studio 42,
Using the "product.parent_id ==0" would have an effect on products that do not have child products.
Thanks again
Mark