- Posts: 100
- Thank you received: 1
How to display remaining quantity for a variant
- paddyrolls
-
Topic Author
- Offline
Less
More
13 years 6 months ago #93378
by paddyrolls
How to display remaining quantity for a variant was created by paddyrolls
Hi
I have an option setup called "Term 1 Week 1" and added to this option is a variant:
For example Tuesday 6pm - 8pm ( + AUD $17.00 )
Could you tell me how I can display the remaining quantity for the variant
For example:
Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5
Thanks for your help
Patrick
I have an option setup called "Term 1 Week 1" and added to this option is a variant:
For example Tuesday 6pm - 8pm ( + AUD $17.00 )
Could you tell me how I can display the remaining quantity for the variant
For example:
Tuesday 6pm - 8pm ( + AUD $17.00 ) Remaining Spots: 5
Thanks for your help
Patrick
Please Log in or Create an account to join the conversation.
13 years 6 months ago #93427
by Xavier
Replied by Xavier on topic How to display remaining quantity for a variant
Hi,
You can edit the view "product / option" and use the var "$optionElement->product_quantity" to display the quantity where you want.
You can edit the view "product / option" and use the var "$optionElement->product_quantity" to display the quantity where you want.
Please Log in or Create an account to join the conversation.
- paddyrolls
-
Topic Author
- Offline
Less
More
- Posts: 100
- Thank you received: 1
13 years 6 months ago #93685
by paddyrolls
Replied by paddyrolls on topic How to display remaining quantity for a variant
HI Xavier
I changed line 87 in file product\option.php file
$text.=' ( '.($positive?'+ ':'').strip_tags($this->loadTemplate()).' )' . " " . $optionElement->product_quantity;
However, if I have
Option 1 Variant 1 - quantity = 3
Option 1 Variant 2 - quantity = 4
The quantity 3 gets displayed for both Variant 1 and Variant 2.
Could you tell me if that is the correct file and where I should add $optionElement->product_quantity
thanks
Patrick
I changed line 87 in file product\option.php file
$text.=' ( '.($positive?'+ ':'').strip_tags($this->loadTemplate()).' )' . " " . $optionElement->product_quantity;
However, if I have
Option 1 Variant 1 - quantity = 3
Option 1 Variant 2 - quantity = 4
The quantity 3 gets displayed for both Variant 1 and Variant 2.
Could you tell me if that is the correct file and where I should add $optionElement->product_quantity
thanks
Patrick
Please Log in or Create an account to join the conversation.
13 years 6 months ago #93967
by nicolas
Replied by nicolas on topic How to display remaining quantity for a variant
Hi,
$optionElement->product_quantity is the quantity of the default variant of the current option.
You should use instead $variant->product_quantity which is the quantity of the current variant of the current option.
$optionElement->product_quantity is the quantity of the default variant of the current option.
You should use instead $variant->product_quantity which is the quantity of the current variant of the current option.
Please Log in or Create an account to join the conversation.
Time to create page: 0.157 seconds