Jump to content

[SOLVED] Selling Items That Are Not Whole Units - Don't Understand the point of Unit Pricing in 1.4 either


Recommended Posts

I realize Rocky has answered this in another thread that fractional quantities can't be done.

The requirements for my shop demand that we absolutely *have* to sell fabric in .25 quarter yards.
There are a number of reasons for this.
1. We *have* to be able to keep track of the number of yards available on a bolt of fabric.
2. We can't fill our page with 4x 15 combinations (a bolt of fabric is 15 yards) That won't be a feasible option.
3. The price per unit feature in 1.4 doesn't seem to affect the price at all i.e.
Unit price without tax: $1.00 per yard
Unit price without tax: $0.25 per .25 yard neither changed the price
What is needed is a simple dropdown that goes .25 .5 .75 1 up to 15 depending on fabric left.


Isn't it just possible to set the inventory at 60 15x4 then simply divide by 4 every time a product combination of Fabric,Bolt is detected?

39055_6vQl1VcYfwYW4qw6LRvh_t

Link to comment
Share on other sites

  • 2 weeks later...

I have a solution to this - it requires modifying exactly the correct db entries
You will want to modify every entry in folder /classes

Code:

where the variables 'qty' or 'quantity' appear

return intval($row['quantity']);


to

return floatval($row['quantity']);




arrays where 'qty' or 'quantity' appear


'quantity' => 'isInt'


to

'quantity' => 'isFloat'



Database:

ALTER TABLE `ps_product` CHANGE `quantity` `quantity` FLOAT( 10, 2 ) NOT NULL 



in

FLOAT( 10, 2 )

the second number will be the total number of decimal places you need to use in your units
ex:

FLOAT( 10, 6 )

will give you 1.000000
for weights such as kg.

any table that uses 'quantity' needs to be checked before altering to make sure it's not a description or
something other than an

INT(10)



The easiest way to get these (without being a db admin) is to go to the 'query' tab for your database in phpMyAdmin and look in the first Field drop down
To make things even easier use firebug right click Field Inspect Element->copy html from the select dropdown

`ps_cart_product` `quantity`
`ps_customization` `quantity`
`ps_customization` `quantity_refunded`
`ps_discount` `quantity`
`ps_discount` `quantity_per_user`
...

Altering ps_product minimal_quantity
creates an error in the backoffice.


I have had no need for setting a minimal quantity
or any problems with minimums in inventory so be aware.

You may need to make modifications to your blockcart module and check any other module that may
attempt to modify quantities .

Also check the code for these values in all new modules before you install them of course
This worked with every module I had except for PayPal which required a whole unit to be submitted to their server.

in resubmit.tpl in modules/paypal change

             
<input type="hidden" name="item_name_{$k+1}" value="{$product.name|escape:'htmlall':'UTF-8'}{if isset($product.attributes)} - {$product.attributes|escape:'htmlall':'UTF-8'}{/if}" />
<input type="hidden" name="amount_{$k+1}" value="{$product.price_wt}" />
<input type="hidden" name="quantity_{$k+1}" value="{$product.cart_quantity}" /> 


to this:

<input type="hidden" name="item_name_{$k+1}" value="{$product.name|escape:'htmlall':'UTF-8'}{if isset($product.attributes)} - {$product.attributes|escape:'htmlall':'UTF-8'}{/if}:{$product.cart_quantity}" />
<input type="hidden" name="amount_{$k+1}" value="{$product.price_wt}" />
<input type="hidden" name="quantity_{$k+1}" value="1" />




In this instance the quantity is 1 the unit number is added to the description so PayPal will result in:

Supplement Ginseng Powder: 1.98
Quantity: 1

Send me a message if you need assistance

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...