Additonal Info value

Completed modifications to the NOP Shopping Cart. Additions, modifications, and more.

Moderators: Koibito, Stefko, Randy, Rosey

Additonal Info value

Postby minolka » Mon Aug 13, 2007 9:07 pm

Hi All,

I need to use the additional info as a numeric value and multiply it by number of items. Any hints.

Thanks,

Lee
minolka
WebMaster
 
Posts: 25
Joined: Wed Jun 06, 2007 2:46 am

Postby Randy » Tue Aug 14, 2007 3:18 am

When you get into AddToCart function, you will have to change the Additional info into a number using either parseInt(additionalinfo) or parseFloat(additionalinfo). They appear as strings (text) leaving the product order form..

Randy
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Postby minolka » Tue Aug 14, 2007 7:34 am

Hi Randy,

It sounds a bit complicated. Is it possible for you to give me a hint on how to add a new value. I have used the shipping value as a point system for the products but now we need a method to assign a weight times quantity without going into the shipping value. Can you please give me some sort of detailed instruction?

Thanks,

Lee
minolka
WebMaster
 
Posts: 25
Joined: Wed Jun 06, 2007 2:46 am

Postby g-wiz » Tue Aug 14, 2007 4:40 pm

add this in the initial section under in your nopcart.js file:
FUNCTION: AddToCart

Code: Select all
   if ( thisForm.ADDITIONALINFO == null ) { //this is changed so a value can be used for additionalinfo for example: cases have a hidden value of 12 & bottles have a hidden value of 1
      strADDTLINFO = "";
   } else {
      strADDTLINFO = thisForm.ADDITIONALINFO.value;
   }


then add this in the initial section, then in the managecart section and the checkout section
Code: Select all
fields[5] = database.substring( Token4+1, database.length );


for example whenever you see this:

Code: Select all
for ( i = 1; i <= iNumberOrdered; i++ ) {
      NewOrder = "Order." + i;
      database = "";
      database = GetCookie(NewOrder);

      Token0 = database.indexOf("|", 0);
      Token1 = database.indexOf("|", Token0+1);
      Token2 = database.indexOf("|", Token1+1);
      Token3 = database.indexOf("|", Token2+1);
      Token4 = database.indexOf("|", Token3+1);

      fields = new Array;
      fields[0] = database.substring( 0, Token0 );                 // Product ID
      fields[1] = database.substring( Token0+1, Token1 );          // Quantity
      fields[2] = database.substring( Token1+1, Token2 );          // Price
      fields[3] = database.substring( Token2+1, Token3 );          // Product Name/Description
      fields[4] = database.substring( Token3+1, Token4 );          // Shipping Cost
      fields[5] = database.substring( Token4+1, database.length ); //Additional Information
      //(cases have a hidden value of 12 & bottles have a hidden value of 1)






so for example this below allows me to do the following calculation and place in the variable named "Qtyship" I created, thus fields 1* fields 5 = (qty chosen) * (additionalinfo value)

Qtyship += parseInt( fields[1] * parseFloat(fields[5])); //Variable for the Dropdown Calculation below
g-wiz
Guru
 
Posts: 32
Joined: Mon Nov 22, 2004 3:30 am

Postby Randy » Tue Aug 14, 2007 11:02 pm

Search the mods section for shipping by weight and adding new fields to the order cookie...

As a start, check out this post: http://www.nopdesign.com/forum/viewtopic.php?t=3862

Randy
Randy
Guru
 
Posts: 1511
Joined: Tue Apr 22, 2003 12:21 pm
Location: Thunder Bay, Ontario

Additional VAR

Postby minolka » Wed Aug 15, 2007 7:54 am

OK, Its 03:49 AM. I can not go on any longer. The shipping by weight is done but I am still having trouble with the additional var. I added two additional var according to the mod and have done everything up to adding;

<input type="hidden" name="PUNTOS" value="21">
<input type="hidden" name="PUNTOS2" value="0">

I dont see the new var when I run the test to see which var is going through.

HELP!!
minolka
WebMaster
 
Posts: 25
Joined: Wed Jun 06, 2007 2:46 am


Return to Modifications

Who is online

Users browsing this forum: No registered users and 0 guests

cron