[Skip to main content](#vessel-content)

#   "HikaShopCustom Quantity plugin"

##

- **[hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile")**
- [![hsojhsoj's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile") Topic Author
- [ Offline](/forum/user/1921-hsojhsoj)

Less More

- Posts: 61
- Thank you received: 0
-
-

11 years 5 months ago [\#205231](#205231) by [hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile")  *["HikaShopCustom Quantity plugin"](/forum/27-checkout/877615-hikashopcustom-quantity-plugin#205231 "-- 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")* was created by *[hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile")*

-- url of the page with the problem -- : [ testpatiodrape.dependentmedia.com/produc...el-rod-straight-ends](http://testpatiodrape.dependentmedia.com/products-listing/product/161-steel-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](http://testpatiodrape.dependentmedia.com/products-listing/product/132-rod)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NzYxNS1oaWthc2hvcGN1c3RvbS1xdWFudGl0eS1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 5 months ago [\#205248](#205248) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *["HikaShopCustom Quantity plugin"](/forum/27-checkout/877615-hikashopcustom-quantity-plugin#205248 "-- 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")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NzYxNS1oaWthc2hvcGN1c3RvbS1xdWFudGl0eS1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile")**
- [![hsojhsoj's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile") Topic Author
- [ Offline](/forum/user/1921-hsojhsoj)

Less More

- Posts: 61
- Thank you received: 0
-
-

11 years 5 months ago -  11 years 5 months ago [\#205332](#205332) by [hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile")  Replied by *[hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile")* on topic *["HikaShopCustom Quantity plugin"](/forum/27-checkout/877615-hikashopcustom-quantity-plugin#205332 "-- 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")*

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 -&gt; Custom Field -&gt; New Item

and the resulting bad math in the cart

- [ ![Screen&#95;shot&#95;2015-06-18&#95;at&#95;10&#95;11&#95;18&#95;AM.png](/forum/attachment/24992) ](/forum/attachment/24992 "...0&#95;11&#95;18&#95;AM.png") [ ](/forum/attachment/24992?download=1 "...0&#95;11&#95;18&#95;AM.png")
- [ ![FieldOrder&#95;length.png](/forum/attachment/24993) ](/forum/attachment/24993 "...der&#95;length.png") [ ](/forum/attachment/24993?download=1 "...der&#95;length.png")
- [ ![cart.png](/forum/attachment/24994) ](/forum/attachment/24994 "cart.png") [ ](/forum/attachment/24994?download=1 "cart.png")

Last edit: 11 years 5 months ago by [hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NzYxNS1oaWthc2hvcGN1c3RvbS1xdWFudGl0eS1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 5 months ago [\#205359](#205359) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *["HikaShopCustom Quantity plugin"](/forum/27-checkout/877615-hikashopcustom-quantity-plugin#205359 "-- 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")*

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-&gt;length) &amp;&amp; !empty($product-&gt;width)){
$quantity = $quantity*$product-&gt;length*$product-&gt;width;
}
You could just add after that (in both places) :
if(!empty($product-&gt;ordered_length) ){
$quantity = $quantity*$product-&gt;ordered_length;
}

and that should do it.

The following user(s) said Thank You: [hsojhsoj](/forum/user/1921-hsojhsoj "View hsojhsoj's Profile"), [durtom](/forum/user/59596-durtom "View durtom's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NzYxNS1oaWthc2hvcGN1c3RvbS1xdWFudGl0eS1wbHVnaW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.070 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
