You are here:  » No Shipping costs if price higher than some number

Active Forum Topics


No Shipping costs if price higher than some number

Submitted by mennov on Wed, 2012-03-21 06:45 in

Hi,

I manually added %DB_shipping% to the database. However for some merchants the shipping costs are 0 if the price of the product is above a certain number.

Would it be possible to make some kind of 'if' statement in the html code, like:

if ( %MERCHANT% = Some_Merchant) THEN IF (%PRICE% > Some_Number) THEN (%DB_shipping% = 0)

Thanks for all your help!

Submitted by support on Wed, 2012-03-21 08:30

Hello Menov,

Sure - you would actually want to implement this within the import record handler in includes/admin.php of your Price Tapestry installation.

In that file, look for the following code at line 343:

    if (!$importRecord["merchant"]) return;

....and REPLACE with:

    if (!$importRecord["merchant"]) return;
    // repeat this block for any other merchants with free shipping > x
    if ($importRecord["merchant"]=="Some Merchant")
    {
      if ($importRecord["price"]>=50.00) $importRecord["shipping"] = "0.00";
    }

(where the free shipping amount is 50.00 in the above example)

Cheers,
David.
--
PriceTapestry.com

Submitted by mennov on Wed, 2012-03-21 09:19

Thanks for this!

Submitted by koen on Thu, 2014-04-24 19:36

Hi David,

I'm trying to apply the currency conversion filter (http://www.pricetapestry.com/node/4910)
after assigning the shipment costs (applied it as described above, I'm trying to convert GBP shipment costs to EUR), but I don't get it working. Think the trouble is that the shipment costs are determined after applying the filters. Do you know a work-around for this one?

Thanks!
Koen

Submitted by support on Thu, 2014-04-24 20:58

Hello Koen,

Yes, there's quite a lot goes on between filters being applied and the above modification, but it's straight forward to "hard code" a particular instance of filter in, so in this case, immediately _after_ the above modification, if you INSERT the new code:

  $importRecord["shipping"] = filter_ccExec(array("cc_from"=>"GBP","cc_to"=>"EUR"),$importRecord["shipping"]);

That should do the trick!

Cheers,
David.
--
PriceTapestry.com

Submitted by koen on Thu, 2014-05-01 20:00

Thanks, works great!