in Education by
Is there a way to add a custom shipping rate for to basket (order) in magento not from admin but in programing. What I need is, I will have a field with each product "shipping_cost" , now suppose customer added 3 products to basket, now the shipping cost of the order will be the highest of shipping_costs of the products. For example, the 3 products have shipping_costs like $10, $20 and $30 , so the shipping_cost for basket will be $30. Please help me out. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Yes,In your conditon you need to get maximum shipping rate and assign that value to $shippingprice. You can add your custom shipping price for an order in magento using given code:- $order = Mage::getModel('sales/order')->load($increamentId, 'increment_id'); $shippingprice = 30; $order->setShippingAmount($shippingprice); $order->setBaseShippingAmount($shippingprice); $order->setGrandTotal($order->getGrandTotal() + $shippingprice); //adding shipping price to grand total $order->save(); It will update your shipping price and grand total.I guess it will helpful to you.

Related questions

0 votes
    I am working on ajax module for Shopping cart in Magento. Consider i have a configurable product with 2 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I'm getting this error when trying to add products to google content, my google account seems ok the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I'm trying to run JMeter for performance testing on a Magento 2 website. So, far I've been able ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to modify the product page. I know what files I need to change, however I can't seem ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    I feel like the flexibility of Magento would allow for my problem to be fixed but I haven't found ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    How can I edit the default Magento contact form to send email with jquery, without quitting the contact ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    How can I edit the default Magento contact form to send email with jquery, without quitting the contact ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I am using a theme which includes meganavigation and has a slide out menu on the navigation where it shows ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    The rate at which cost changes with respect to weight or bias is called _________. A. Loss B. Gradient C. Rate of Change D. Derivative...
asked Dec 26, 2022 in Technology by JackTerrance
0 votes
    The rate at which cost changes with respect to weight or bias is called _________. A. Loss B. Gradient C. Rate of Change D. Derivative...
asked Nov 13, 2022 in Education by JackTerrance
0 votes
    I understand Amazon will charge per GB provisioned EBS storage. If I create AMI of my instance, does this mean ... Machine Image)? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    Cost saving is possible in networking due to: (a)Data sharing (b) Software sharing (c) Both i and ii (d)None of these Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    How many Crafting Metals does The Plague Doctor skin for Bloodhound cost? apex legends Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Why take derivative of a function in neural network cost function? Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    How do you computers networks help in reducing the cost and saving money very short answer Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
...