Supertex Posted January 8, 2022 Share Posted January 8, 2022 So the fedex web services module that's available in the addons section will pull quotes, but most of the other features don't work...specifically insurance. Soooo...I tried to a cart value check and add the appropriate fees to the shipping method from within the module. I couldn't get that to work. But what I could (and did) do was calculate the appropriate fees in shopping_cart.php, and put that into a session variable: //set insurance figures for fedex shipping methods $pkg_val = $cart->show_total(); if ($pkg_val <= 100){ $insurancemarkup = 0; }else if (($pkg_val > 100)&&($pkg_val <= 300)){ $insurancemarkup = 3; }else if ($pkg_val > 300){ $insurancemarkup = (ceil($pkg_val/100)); } tep_session_register ('insurancemarkup'); Then I did this in the fedexwebservices.php file itself: function quote($method = '') { /* FedEx integration starts */ global $shipping_weight, $shipping_num_boxes, $cart, $order, $insurancemarkup; And and then this also: $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType), 'title' => ucwords(strtolower(str_replace(array('_', ' HOME', 'DELIVERY'), array(' ', '', ''), $rateReply->ServiceType))) . ' <font color="orange">(signature may be required)</font>', 'cost' => $insurancemarkup + $cost + (strpos($this->types[$rateReply->ServiceType]['handling_fee'], '%') ? ($cost * (float)$this->types[$rateReply->ServiceType]['handling_fee'] / 100) : (float)$this->types[$rateReply->ServiceType]['handling_fee'])); This works fine...most of the time. However, someone will occasionally manage to place an order and have $insurancemarkup as zero. Handling fees are correctly calculated, prices are coming back correctly...it just doesn't add the insurance. I don't know if they're creating a cart from work and then coming home to actually place the order, or...? Again...this is a rare occurrence but it can really cause problems; especially when I cannot replicate the error. Is there a way to successfully make the calculations from within the module? Have I gone about this in a foolish manner? Thoughts? osC v2.3.1 MySQL v8.0.32 PHP v5.6.40 Installed addons: . Attribute Sets Plus .. Create Account & Manual Order Maker .. Customer Testimonials 2.3.4 .. Customer Blacklist .. Dynamic Info Pages .. FedEx Web Svcs v9 .. Filtered Sales Report .. Generic Box .. Google XML Sitemap SEO .. Maximum Order Value .. Modular Front Page .. Monthly Sales & Tax Report .. Multiple Products Manager .. Must Accept Terms & Conditions .. Order Editior .. PDF Customer Invoice .. Price in Cart Only .. Product Sort/Order .. Product Sort in Cart .. Quantity Discounts .. Restrict Delivery Methods .. SEO Header Tags - Reloaded .. Separate Pricing Per Customer .. Simpler Admin Session Length Control .. Sitemap SEO .. Show Free Ship + Modules .. Specials by Category for SPPC .. Store Mode (open|closed|maintenance) .. Store Pickup Shipping .. Theme Switcher .. Ultimate SEO URLs 5 Pro .. UPS XML Rates & Svcs 1.4 .. USPS methods 7.3.1 .. Who's Online Dashboard . Fixes: Add to cart -> 'product not found' : FIX Login issues with IE 11 : FIX Tools: Incredibly Handy: osC Xref Link to comment Share on other sites More sharing options...
Supertex Posted January 12, 2022 Author Share Posted January 12, 2022 @kymation osC v2.3.1 MySQL v8.0.32 PHP v5.6.40 Installed addons: . Attribute Sets Plus .. Create Account & Manual Order Maker .. Customer Testimonials 2.3.4 .. Customer Blacklist .. Dynamic Info Pages .. FedEx Web Svcs v9 .. Filtered Sales Report .. Generic Box .. Google XML Sitemap SEO .. Maximum Order Value .. Modular Front Page .. Monthly Sales & Tax Report .. Multiple Products Manager .. Must Accept Terms & Conditions .. Order Editior .. PDF Customer Invoice .. Price in Cart Only .. Product Sort/Order .. Product Sort in Cart .. Quantity Discounts .. Restrict Delivery Methods .. SEO Header Tags - Reloaded .. Separate Pricing Per Customer .. Simpler Admin Session Length Control .. Sitemap SEO .. Show Free Ship + Modules .. Specials by Category for SPPC .. Store Mode (open|closed|maintenance) .. Store Pickup Shipping .. Theme Switcher .. Ultimate SEO URLs 5 Pro .. UPS XML Rates & Svcs 1.4 .. USPS methods 7.3.1 .. Who's Online Dashboard . Fixes: Add to cart -> 'product not found' : FIX Login issues with IE 11 : FIX Tools: Incredibly Handy: osC Xref Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.