Jump to content

How do I choose or change Quantity when ordering from Pieces into Meters?


Recommended Posts

  • 1 month later...

Hi !
I have the same problem right now.
If I find some ideas, I'll come back !
It's my first business site and I would be proud to come back with some ideas ! :roll:
The idea I am investigating, is to put a label right after the quantity input place, saying "m" when the product is sold in meters, or "units", when the selection (might be an attribute) is sold by units.
With a code like : IF ... THEN ...ELSE
I think this must have happened before, but I found no thread in this forum as of today.
Such an indication directly attached to the quantity enter case would be far more clever than asking the consumer to read descriptions, how-to's, or specs to guess what to do !

Link to comment
Share on other sites

Well : this is what I did :
If there is a more elegant way to reach the objective, please tell me !

The idea here is to use a product description parameter which is left unused in your e-commerce process virtualisation.
In this case : my customer does not address inventory management, so the variables regarding inventory management are available for other purposes.
I used the location of the product in the warehouse : called "emplacement" (french), or "location" (english).
When adding a new product, just fill that parameter with the "type of unit" in which the product is ordered.
(length-meters, weight-kg, ...)
I am considering that the default "quantity" indication is already well adapted to suggest that the product has to be ordered in "units", so there is nothing to change for a product sold unit by unit.
When the product is sold meter by meter (like a rope for example), here is the way to have the "enter quantity" block automatically give the "measurement unit" information to the customers :

First of all : Go in your product data sheet in the BackOffice. For each product sold "in meters" :
enter : "meter(s)" (english) or "metre(s)" (french)
where : in the "location" (english) or "emplacement" (french) data entry point.
Confirm modification.

Second : Open product.tpl. Find the "quantity wanted" paragraph (line 266 approx)
After the line :

<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />


Enter this new line :

{if $product->location}{$product->location|escape}{/if}


Save the file
Result should look like this :

quantity == 0) || $virtual} style="display:none;"{/if}>
{l s='Quantity :'}
               <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />
               {if $product->location}{$product->location|escape}{/if}



Note : wwwilliam css class could be named differently of course ! :)

Third : Open global.css file. Find the /* product.tpl */ paragraph. (line 1839 approx). Scroll down.
Find :

#primary_block form#buy_block span.our_price_display{
   float:right;
}


Add a new line after this paragraph.
Enter the following class :

#wwwilliam{
margin-left: 0.0em;
text-align:right;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, Sans-Serif;
float:left;
outline: none;
}


Save your global.css file.

Result shouls look like this :

#primary_block form#buy_block span.our_price_display{
   float:right;
}
#wwwilliam{
margin-left: 0.0em;
text-align:right;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, Sans-Serif;
float:left;
outline: none;
}
#primary_block form#buy_block span#availability_label{
   float:left;
   margin-right:1em;



Should work fine.
Prestashop version 1.2.5

Any feedback is welcome !

23921_Ekz41gAskU2MrzeVUGPE_t

23922_o079WuvXeE8bh6v0cIgN_t

Link to comment
Share on other sites

  • 2 months later...

Hi !

product.tpl is here :
...root.../themes/prestashop/product.tpl

global.css is here :
...root.../themes/prestashop/css/global.css

Edit with notepad(easy but no text formatting) or dreamweaver (preferably).

Hope this helps.

wwwilliam

Link to comment
Share on other sites

  • 5 months 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...