Is there any way to display the shipping category value for a given product?
Announcement
Collapse
No announcement yet.
Display shipping category value
Collapse
X
-
You could use the weight of the product in blockifs to relay the costs, the more weights and more weight tiers you have the more complicated it would get, but certainly possible. Do the blockif tutorials on the forum if you want to learn about those.
Pseudo code within each blockif:
if weight == 0.25
cost of shipping = £2.50
endif
if weight == 0.50
cost of shipping = £3.50
endif
etc.
Comment
-
Revisited
I gave up on this (as I was happy with current solution and others weren't) but unfortunately had to spend more time looking at it today. I wanted to share my attempts incase anyone else was looking for such functionality.
This is no doubt very inelegant and can be improved upon if you actually have a decent working knowledge of how php and databases work.
HTML Code:<actinic:block type="PriceList"> <actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201" > <actinic:block php="true" SELECTABLE="false"> $taxrate = 0; $exc = preg_replace('/[^0-9]/', '', '<actinic:variable name="TaxExclusivePrice" />'); $inc = preg_replace('/[^0-9]/', '', '<actinic:variable name="TaxInclusivePrice" />'); if ( ($exc != 0) && ($exc != $inc) ) { $taxrate = ($inc - $exc) / $exc; } $taxrate = sprintf("%01.3f", $taxrate); $taxrate = $taxrate + 1; </actinic:block> </actinic:block> </actinic:block>
HTML Code:<actinic:block php="true" > $connect = odbc_pconnect("ActinicSimpleShipping<actinic:variable name="ECMajorVersion" selectable="false" />","","", SQL_CUR_USE_ODBC); $freeover_query = "SELECT dBandFreeOverThreshold FROM BandDefinition"; $freeover_results = odbc_exec($connect, $freeover_query); $freeover_results = odbc_result($freeover_results, 1); $freeover_results = sprintf ("£%01.0f", (($freeover_results * $taxrate)/100)); // Use statement below to call Free over value // print $freeover_results; $designator_query = "SELECT nID FROM Categories WHERE sDescription='<actinic:variable name="ShippingCategory" selectable="false" />'"; $designator_results = odbc_exec($connect, $designator_query); $designator_results = odbc_result($designator_results, 1); if($designator_results==1){ $query = "SELECT dFixedCharge FROM ZoneCategoryCharges WHERE nCategoryID=1"; $result = odbc_exec($connect, $query); $result = odbc_result($result, 1); $result = sprintf ("£%01.2f", (($result * $taxrate)/100)); } elseif($designator_results==2){ $query = "SELECT dFixedCharge FROM ZoneCategoryCharges WHERE nCategoryID=2"; $result = odbc_exec($connect, $query); $result = odbc_result($result, 1); $result = sprintf ("£%01.2f", (($result * $taxrate)/100)); } elseif($designator_results==3){ $query = "SELECT dFixedCharge FROM ZoneCategoryCharges WHERE nCategoryID=3"; $result = odbc_exec($connect, $query); $result = odbc_result($result, 1); $result = sprintf ("£%01.2f", (($result * $taxrate)/100)); } elseif($designator_results==4){ $query = "SELECT dFixedCharge FROM ZoneCategoryCharges WHERE nCategoryID=4"; $result = odbc_exec($connect, $query); $result = odbc_result($result, 1); $result = sprintf ("£%01.2f", (($result * $taxrate)/100)); } else{ print "DELIVERY CALCULATION TO BE DEFINED"; } // Use statement below to call delivery cost for this products category // print $result; odbc_close_all(); </actinic:block>
Dave
Comment
Comment