- Posts: 61
- Thank you received: 0
"HikaShopCustom Quantity plugin"
11 years 3 months ago #205231
by hsojhsoj
"HikaShopCustom Quantity plugin" was created by hsojhsoj
-- url of the page with the problem -- :
testpatiodrape.dependentmedia.com/produc...el-rod-straight-ends
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.13
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : no error message
I have a drape product configured successfully to multiply width and length for a total price per square foot but i also would like to have a rod product that multiplies the price per foot only for length. So length multiplied by price per foot.
$5 per foot x 10 feet = $50
A link to my unsuccessfully product configuration is here:
testpatiodrape.dependentmedia.com/produc...ting/product/132-rod
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.13
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : no error message
I have a drape product configured successfully to multiply width and length for a total price per square foot but i also would like to have a rod product that multiplies the price per foot only for length. So length multiplied by price per foot.
$5 per foot x 10 feet = $50
A link to my unsuccessfully product configuration is here:
testpatiodrape.dependentmedia.com/produc...ting/product/132-rod
Please Log in or Create an account to join the conversation.
11 years 3 months ago #205248
by Xavier
Replied by Xavier on topic "HikaShopCustom Quantity plugin"
Hi,
You have to use the Custom quantity plugin indeed, but to use it correctly, you have to create a custom item field with a column name equal to "ordered_length".
This way it will do the calculation based on the value set in that custom field.
You have to use the Custom quantity plugin indeed, but to use it correctly, you have to create a custom item field with a column name equal to "ordered_length".
This way it will do the calculation based on the value set in that custom field.
Please Log in or Create an account to join the conversation.
11 years 3 months ago - 11 years 3 months ago #205332
by hsojhsoj
Replied by hsojhsoj on topic "HikaShopCustom Quantity plugin"
The "Custom quantity plugin" should already be installed successfully because I am using it to calculate the price per foot correctly, right? Here are screenshots of the configuration I have setup for the Display -> Custom Field -> New Item
and the resulting bad math in the cart
and the resulting bad math in the cart
Last edit: 11 years 3 months ago by hsojhsoj.
Please Log in or Create an account to join the conversation.
11 years 3 months ago #205359
by nicolas
Replied by nicolas on topic "HikaShopCustom Quantity plugin"
Hi,
There is a misunderstanding here.
There are several custom quantity plugins.
You have installed one which handle the width*length calculations.
If you want to handle length calculations, you would need another one.
However, two custom quantity plugins cannot work together. So that leaves you with having to modifying the one you have to handle the calculations in both cases.
It's not complex. Edit the plugin php file and you'll see this piece of code (twice in the file) normally:
if(!empty($product->length) && !empty($product->width)){
$quantity = $quantity*$product->length*$product->width;
}
You could just add after that (in both places) :
if(!empty($product->ordered_length) ){
$quantity = $quantity*$product->ordered_length;
}
and that should do it.
There is a misunderstanding here.
There are several custom quantity plugins.
You have installed one which handle the width*length calculations.
If you want to handle length calculations, you would need another one.
However, two custom quantity plugins cannot work together. So that leaves you with having to modifying the one you have to handle the calculations in both cases.
It's not complex. Edit the plugin php file and you'll see this piece of code (twice in the file) normally:
if(!empty($product->length) && !empty($product->width)){
$quantity = $quantity*$product->length*$product->width;
}
You could just add after that (in both places) :
if(!empty($product->ordered_length) ){
$quantity = $quantity*$product->ordered_length;
}
and that should do it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.190 seconds