Jump to content


Photo

Shipping For Multiple Items


  • Please log in to reply
1 reply to this topic

#1 HansFouche

HansFouche

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 September 2013 - 10:17 AM

At first I thought this was simple but now a week in still no joy.

I am using the simplecart.js code and wish to customize it regarding the shipping.

What I have is 7 items to be sold and with each additional item it should charge an additional shipping fee.

Sounds easy PAYPAL does offer the shipping2 feature but because of the for loop it only works for additional items per SKU(item).

If I added a diffirent SKU(item) it would charge the initial shipping cost ontop of the other item's shipping cost.

Example: (shipping = $5, shipping2 = $2)

32gb USB flash X 2 = $5 + $2 = $7. This is correct

but if:

32gb USB flash X 2 =  $5 + $2 = $7

16gb USB flash X 1 = $5 incorrect it should be $2.

Total shipping is: $$7 + $5 = $13 incorrect it should be $7 + $2 = $9

 

Please help, below is my code for the paypal checkout. in fact I will just attach all my code for HTML page aswell.

 

PLEASE HELP?

Attached File  codes.zip   8.79KB   0 downloads



#2 HansFouche

HansFouche

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 September 2013 - 12:29 PM

I was told about advanced variables for shipping discounts. Anyone please help.

Below is the piece of specific code:

// send user to paypal checkout with all the items in the 
cart this.checkOut = function() {  if( this.totalItems == 
0 ){   alert("Your cart is 
empty!");   return 
false;  }    var winpar = 
"scrollbars,location,resizable,status";  var 
i,j=0,des,counter;    var strn  = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" 
+        "&upload=1" 
+          
 "&business=" + this.userEmail 
+     "&currency_code=USD" 
+       "&lc=US";  counter = 
0;    for (counter = 0; counter < 
this.items.length; counter++) {   tempItem = 
this.items[counter];   j = counter + 
1;         strn = strn 
+  "&item_name_"    + j + "=" + 
tempItem.getValue('name') 
+                  
 "&item_number_"  + j + "=" + j 
+                  
 "&quantity_"     + j + "=" + 
tempItem.getValue('quantity') 
+                  
 "&amount_"       + j + "=" + 
Math.round((tempItem.getValue('price') / 
(parseFloat(document.getElementsByName("target_value")[0].value))) / 100 * 100) 
+        
    "&shipping_"     + j + "=" + 
Math.round(50.00 / 
(parseFloat(document.getElementsByName("target_value")[0].value)) / 100 * 100) 
+       "&shipping2_"    
+ j + "=" + Math.round(25.00 / 
(parseFloat(document.getElementsByName("target_value")[0].value)) / 100 * 100) 
+       "&no_note_"   
  + j + "=" + 
"1";     }  window.open 
(strn, "paypal", winpar);  return false; };





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users