View Full Version : Problem! Fraction for the quantity.
Hi i am selling textile and my product is measure in length. So i uses the length as my weight. example: 1m = 1 kg.
Now the problem when a customer want to buy 1.5m of cloth, so the length they key in will be 1m, but actinic only accept whole number for the weight. how can it be solve? Thx !!
NormanRouxel
19-Jul-2003, 08:56 AM
As you can only buy in quantities that are integer units have you considered selling by the centimetre?
You'll have to consider the effects of having a price for 1 cm of fabric - this might be too small to fit into Atinic's other limitation of integral pennies (or cents) for the price.
Norman
No, the smallest unit is 0.5metre. My question is the quantity actinic allow is integer. How to solve it? thx
NormanRouxel
19-Jul-2003, 11:41 PM
There are several ways around this. However none are simple and most rely on JavaScript. This one doesn't. In your product name add the text "(sold 1/2 Metre units)"
Price the product per half metre.
Copy your product template to a new file name e.g. FabricProductTemplate.html and in that template replace:-
NETQUOTEVAR:PRODUCTQUANTITY with:-
<SELECT NAME="Q_NETQUOTEVAR:PRODUCTREFERENCE">
<OPTION VALUE="1">0.5</OPTION>
<OPTION VALUE="2">1.0</OPTION>
<OPTION VALUE="3">1.5</OPTION>
<OPTION VALUE="4">2.0</OPTION>
<OPTION VALUE="5">2.5</OPTION>
<OPTION VALUE="6">3.0</OPTION>
</SELECT>
Use this template for products you sell by length and this will only allow an input of 0.5 to 3.0 metres in half metre lengths. The quantity will be shown in half metre amounts and the bit you added to the product name will appear in the checkout to keep the customer informed as to what's going on.
Of course you can pad out the <option...> list to suit the range of lengths that your customers are likely to buy.
Norman
p.s. If you want to see what can be done with a lot of JavaScript and perl mod's then see the demo at:- http://www.drillpine.biz/voilenet/acatalog/More_Products.html where custom made curtains are being made to order with all the calculations and pricing being done in real-time on the order page.
Copy your product template to a new file name e.g. FabricProductTemplate.html and in that template replace:-
NETQUOTEVAR:PRODUCTQUANTITY with:-
Where is the NETQUOTEVAR:PRODUCTQUANTITY in the product template u mean? I cant find it..
I only manage can see this ,
[Templates]
Act_ProductLine.html=Actinic original product template.
Act_CenterProductLine.html=Vertically centered text.
Act_LeftProductLine.html=Text to the left of the image.
Act_RightProductLine.html=Text to the right of the image.
Act_ProductLine1.html=No image. Description under name and button.
Act_ProductLine2.html=Allows much larger product images.
Act_ProductLine3.html=Image down left hand side. Name above image.
Act_ProductLine4.html=No image or description. Laid out in single line.
Act_DummyProductLine.html=Product name and description only.
Act_ProductLineTextOnly.html=Description only, useful for inserting messages
[Act_ProductLine.html]
Preview=Original.bmp
[Act_CenterProductLine.html]
Preview=Center.bmp
[Act_LeftProductLine.html]
Preview=LeftText.bmp
[Act_RightProductLine.html]
Preview=RightText.bmp
[Act_ProductLine1.html]
Preview=NoImage.bmp
[Act_ProductLine2.html]
Preview=LargeImage.bmp
[Act_ProductLine3.html]
Preview=ImageLabelLeft.bmp
[Act_ProductLine4.html]
Preview=SingleLine.bmp
[Act_DummyProductLine.html]
Preview=DummyProduct.bmp
[Act_ProductLineTextOnly.html]
Preview=TextOnly.bmp
Will u help to point it out?
Thx.
Now i am trying to seperate the whole number quantity with the decimal quantity such as 0.5meter. I got a problem when i type in the quantity, u may want to go to http://www.hst.com.sg/acatalog/Mircofibre.html to try to puchase an item with like 5 metre and 20cm, the result i wants is the price for 5m and 20cm, but the come out as 5 metre + (20*5). How to solve it? Thx!
chrisbrown
21-Jul-2003, 08:59 AM
Kai,
Norman is referring to the Act_ProductLine.html file (or whatever), not the ProductTemplates.ini.
You will probably have more than one Act_ProductXXXX.html file in your Site1 folder. You need to make a copy of the one that you are currently using for these products and make the suggested changes in there.
Then you need to tell Actinic to use the new template in the Product Details popup, General tab, Product Layout. Use the Select button to locate the new template file. If you want to apply the template to all the products in a section, set the Default Template in the Section popup, Product tab.
For future convenience, you can edit the ProductTemplates.ini file to add your new template (maybe with a preview image as well).
Hi,
The method Norman is saying is good, but if a customer is buying 20m of cloth, i will have a very very long listbox. So i now trying to combine the quantity with another listbox with length lesser than 1m so them to choose. So i encounter a problem:
Now i am trying to seperate the whole number quantity with the decimal quantity such as 0.5meter. I got a problem when i type in the quantity, u may want to go to http://www.hst.com.sg/acatalog/Mircofibre.html to try to puchase an item with like 5 metre and 20cm, the result i wants is the price for 5m and 20cm, but the come out as 5 metre + (20*5). How to solve it? Thx
cdicken
21-Jul-2003, 02:05 PM
Are you doing the 20cm with a component? If so then this will not work as the component quantities are always tied to the main product quantities.
The only way you could do it is have the units and the sub-units as two separate products, and then use a 'Shopping Mode' of 'Quantity on Product Page' with 'Single Add to Cart Button' per page. That way, people will be able to select unit quantity and then the sub-units independently.
Otherwise, I'm afriad you are stuck with Normans rather elegant suggestion of the drop-down list for half-units.
NormanRouxel
21-Jul-2003, 07:00 PM
Elegant - that's me to a T. :cool: Anyway regarding the drop down lists. I've seen a site who use a list with 500 terms in it (whew!) and it isn't too daunting to use. It only takes one line on the screen and will only be used if the customer intends to buy.
If your worried about page size (due to all those <OPTION..> tags) then this can easily be fixed by using a tiny JavaScript loop to document.write the lot so only a few bytes of code are needed to generate the lot.
Norman
Hi, cdicken
If i follow the way u metioned. I will have 2 Quantity textbox, 1 for the main length and 1 for the sublength, although it is only 1 add to cart button. Customer will have to key in the quantity they want, then key in 1 for the quantity in the component then select the additional length. How to hide the quantity textbox and make it default 1? Thx
Hi, NormanRouxel
I dont think i can affort to write all the length dimension as it ca go as small as .2 metre to 100 metre.. Any suggesttion? Thx
Also i will like add a left navigation on the left of the page for all the pages without using a frame, which page should i go to edit? Thx.
Kai
NormanRouxel
22-Jul-2003, 08:51 AM
Hi, NormanRouxel
I dont think i can affort to write all the length dimension as it ca go as small as .2 metre to 100 metre.. Any suggesttion? Thx
Here's an alternative way of getting the count of 20cm lengths into the product quantity field. You could use JavaScript to accept a numeric input, round it to the next 20cm and then place that number (of 20cm's) into the a hidden quantity field.
You comment out NETQUOTEVAR:PRODUCTQUANTITY and replace it with
<input type="hidden" name="Q_NETQUOTEVAR:PRODUCTREFERENCE" value="0">
<input type="text" name="JV-NETQUOTEVAR:PRODUCTREFERENCE" onchange=fixlength('NETQUOTEVAR:PRODUCTREFERENCE',this.value)">
I'll leave the writing of fixlength 'till later or you can do it yourself. Basically it validates and rounds up the value this.value and then places the result (in units of 20cm) into the hidden field Q_NETQUOTEVAR:PRODUCTREFERENCE which is what Actinic expects the product quantity to be in.
Another thing you'll have to consider, whichever way you go is what happens when the item is in the cart. The customer is able to amend the quantities in the cart so could (if you go with a 20cm sub-product) change that to a crazy number. I.e 1 metre of main product and 123 20cm's of sub-product. That won't be a problem if you go with the single 20cm based product.
Norman
Hi, Norman,
U said u can use a loop for the quantity?how? and where should i apply the product templete after changes the NETQUOTEVAR:PRODUCTQUANTITY in the product page. Pardon me as it is the first time i am using actinic and this is the so call only major problem i face for this project... Really appeciate if u can show me step by step. Thx
cdicken
23-Jul-2003, 09:08 AM
How to hide the quantity textbox and make it default 1? Thx
Go to 'Design | Options | Layouts' and click the 'Edit' button next to 'Default Product Layout'.
Save it as Act_ProductLineHiddenQuantity.html
Within the template, replace
NETQUOTEVAR:PRODUCTQUANTITY
with
<!-- NETQUOTEVAR:PRODUCTQUANTITY --><input type="hidden" name="Q_NETQUOTEVAR:PRODUCTREFERENCE" value="1">
You can now select this template within the 'General' tab for any product that you want to have a hidden quantity.
Wah. Is done and solved. Thx alot cdicken! and Norman too. :)
NormanRouxel
23-Jul-2003, 11:45 AM
Kai,
You may be interested in this JavaScript and template modification solution as it allows the customer to input the number of metres they want (like 1.3). It then rounds it to the next 20cm (like 1.4), calculates the number of 20cm units needed (7) and displays both the 1.4 Metres and 7 Units using the Other Info Prompt.
It's quite a big patch so I've attached it as a readme file.
If you like this let me know and I'll send some more mod's that will disable the customer being able to edit the quantities in the shopping cart as this would prevent the real length and units getting out of sync.
Norman
Hi Norman,
You are being so helpful. :) The step is really so clear and brief. I followed what u have mention and I think i mess it up, u may want to have look at http://www.hst.com.sg/acatalog/Fancy.html and try to add a product, the 20cm dont seem to work. And why u need a length prompt? Thx Norman.
NormanRouxel
24-Jul-2003, 07:51 AM
Kai,
You need to set the sections Shopping Mode to "Quantity on Product Page" for this patch to work. Sorry - I forgot to mention that.
Re the Other Info prompt. It's very useful as it will display both the number of metres ordered and a message showing that the cart quantity is in 20cm units. Try it and see.
Norman
Hi Norman u may like u check this, i tried to set the product quantity on product page but it dont accept any number, even whole number. Also how to splint products into different page using the next and back button? rather than subsection on top.
Thx
http://www.hst.com.sg/acatalog/Fancy.html
NormanRouxel
25-Jul-2003, 08:22 AM
Kai,
It works fine for me from here. I placed a test order for 1.3 metres and it was correctly rounded to 1.4. Try hitting "Refresh" on your browser.
Norman
Details below:-
Date: 25 July 2003
Order Number: NNRMAN00000001
Payment method: Credit Card
Credit Card: Mastercard
Shopping Cart (Prices in Singapore Dollars)DESCRIPTION QUANTITY PRICE COST
lala 7
Length
1.4 Metres - (7 x 20cm Units)
S$20.00 / $12.00 S$140.00 / $84.00
Hi Norman, the quatity do jump from 1.3 to 1.4 for a flash of sec but there is this message keep coming out, even if i key in whole number. I dont understand why yours can work.
Length: The length must be a whole number between 1 and 32767
Thx
NormanRouxel
25-Jul-2003, 11:23 PM
Kai,
It works fine from here. You can change the quantity and then click anywhere (even on some blank area) except the add to cart button to see the rounding up working.
Do not use Autocomplete to fill in the entry as there is a bug in Internet Explorer (tut-tut Bill G.) that fails to fire the onchange event if you use autocomplete. Type the value in each time and see if that helps. Don't worry about this I've an update coming that will fix this.
Also:-
What version of web browser are you using? Use Help / About to find out.
Also do the same for Actinic and let me know.
Norman
Hi Norman, I try it on my friend's pc and it wk fine. What is the problem in my pc and my office's one? I didnt use the auto complete at both places. Currently i am off for this 2 days, so i cant really tell u what ver i am using. If it is about the ver, will it be user friendly if we have to ask the customer to update it? Thx
NormanRouxel
26-Jul-2003, 07:42 AM
Kai,
The JavaScript is quite simple so I doin't think that there will be a problem for your customers.
You'll have noticed that the customer could display the cart and edit the Quantity or Informative field. This could be very confusing as it could lead to contradictory orders being made.
Please let me know your e-mail address so I can send you an update that fixes that and also allows the fractional quantity to be editable in the Display Shopping Cart phase.
This is quite a useful patch so I'll probably not give it away free. As you prompted me to write it you can have a free copy.
Norman
chrisbrown
26-Jul-2003, 04:18 PM
Good going Norman! :p
I would have a customer for the patch if it could also deal with rounding up metres to multiples of 10 metres.
For price comparison reasons the customer really needs to quote prices per metre but only sells in multiples of 10 metres.
NormanRouxel
26-Jul-2003, 05:59 PM
Chris,
What you want is quite feasible as it's a bit of JavaScript that decides how many items you're allowed to order and then either rounds it up or down. It would be easy to change that script to accept any number and to round to the next multiple of 10 (or to warn if the amount isn't such a multiple if you prefer it that way).
Have alook at Kai's site and see the code in action. He's not yet using the finished product (it only allows the cart to be edited as per the product page type rules).
As the script also runs when you display the cart it would only allow alterations to be made that obey the same rules.
I'd be happy to modify the script to do what you want but as there are some Perl patches required (only a few lines in ActinicOrder.pm - but working them out isn't trivial) I'm afraid this will be a chargeable patch. Contact me off the forum if you like and we can discus how much it would cost. I'm on rouxel@drillpine.biz and am UK based 'tho I'm on extended holiday in Turkey at the moment.
Norman
Hi Norman, i finally know where the problem lie. U try hitting submit the cart with ENTER rather than click on the add to cart button. U will know what i mean. And if u willing to give me the code for the customer unable to edit the quantity at the shopping cart, i will really appeciate. :)
NormanRouxel
27-Jul-2003, 11:03 PM
Kai,
I need your e-mail address so I can send the patch directly to you. Your profile on this Forum doesn't allow e-mails.
I'll look into the Enter key problem as well.
Norman
My email add is japinamoto@hotmail.com
Also i will like to ask is it difficult if i want it to be only in 0.1 or it make life easier for u?
NormanRouxel
28-Jul-2003, 07:59 AM
Kai,
Textfile is on it way.
Re selling in 0.1m units - just change the "5"'s in the JavaScript
var intval = Math.ceil(val * 5); // number of 20cm units rounded up
val = intval / 5; // round back to decimal value to nearest 20 cm
To be "10"'s and alter any descriptive text to suit.
Norman.
Hi, Norman, Thx for the code. You may want to go http://www.hst.com.sg/acatalog/Fancy.html to see if i did it correctly. 1 problem is that, the price customers see is the price for 0.1 metre, can we write the price as per 1m at the product page for customer to see, and calculate as 0.1 at the cart.? Also, how to solve the enter thing? If cant is ok. U help alotssss. :)
U may also will like to go http://www.hst.com.sg/acatalog/Plain.html to see what can i do for it. The page is simply too long. Thx Norman.
Kai
NormanRouxel
28-Jul-2003, 12:08 PM
Kai,
Update is on it's way that fixes the Enter problem.
I'm not sure if it's easy to fix the price prompt. I'll think about it. More later.
Re the very long page - you'll just have to break that huge section into sub-sections regarding different types of fabric or colour ranges. No-one will want to look at a list that long.
Norman
Hi Norman, there is some minor porblem on the patch. U try placing a quantity then u press enter, nothing will change, u will have to click blank space outside the textbox then the quantity will round off, then u can press the enter button. Thx
NormanRouxel
29-Jul-2003, 10:15 AM
That's right. The Enter key doesn't make the fractional quantity calculation correctly so I've disabled it just for those products.
You have to use the Add to Cart Button.
This is how nearly everyone expects to do things. Using the enter key when submitting a form is nearly always bad news as it leads to partially completed forms.
I've also added a bit of code that will show the price per metre on the product page (alongside the price per 10cm unit). It's on it's way by e-mail.
Norman
NormanRouxel
29-Jul-2003, 11:31 AM
Here's a patch to my patch that will display the product prices per metre on the product page.
Norman
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.