USPS Online Prices?

  • Posts: 12953
  • Thank you received: 1778
9 years 6 months ago #173848

Hello,

If you want to apply for example, only 50% of the price of your USPS shipping method, the solution will be to change these lines :

foreach($rates as $finalRate) {
	$finalRate->shipping_ordering .= '_'.$i++;
	$usable_rates[$finalRate->shipping_id] = $finalRate;
}
By :
foreach($rates as $finalRate) {
	$finalRate->shipping_price = ($finalRate->shipping_price * 50 ) / 100;
	$finalRate->shipping_ordering .= '_'.$i++;
	$usable_rates[$finalRate->shipping_id] = $finalRate;
}

Last edit: 9 years 6 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 25
  • Thank you received: 1
9 years 6 months ago #176021

Mohamed Thelji wrote: Hello,

If you want to apply for example, only 50% of the price of your USPS shipping method, the solution will be to change these lines :

foreach($rates as $finalRate) {
	$finalRate->shipping_ordering .= '_'.$i++;
	$usable_rates[$finalRate->shipping_id] = $finalRate;
}
By :
foreach($rates as $finalRate) {
	$finalRate->shipping_price = ($finalRate->shipping_price * 50 ) / 100;
	$finalRate->shipping_ordering .= '_'.$i++;
	$usable_rates[$finalRate->shipping_id] = $finalRate;
}


I don't see those 3 lines of code in the file. Are you referencing the most up to date plugin? Is there a reason you can just plug a negative percentage into the Percentage field in the plugin? I tried doing it but there doesn't seem to be any consistency to how the value is applied.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 6 months ago #176189

Yes,
I'm referencing the most up to date plugin, are you editing the "plugins\hikashopshipping\usps\usps.php" file ?

Please Log in or Create an account to join the conversation.

  • Posts: 25
  • Thank you received: 1
9 years 6 months ago #176301

Line #251 shows this:

				foreach($rates as $finalRate) {
					$usable_rates[$finalRate->shipping_id] = $finalRate;
				}

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 6 months ago #176328

Ok, so can you download the last Hikashop version through our website, install it and check it again ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum