Virtuemart get the shipping and handling costs from where? - virtuemart

This might be a long shot, but I am trying to find what global variable holds the shipping and handling amount in virtuemart?
I see it is set using $shipping_display, but whenever I run a var_export($shipping_display) is NULL. However, if i make an order, it is showing on the page...
Any thoughts?!

Related

performance testing of add to cart product in magento using jmeter

I am creating a JMeter Script to add products into the cart for the Magento2 website. Post request is executing without any error but the product isn't displaying into cart after that request.
Check snap of post request
JMeter automatically treats HTTP responses with status codes below 400 as successful, it doesn't know anything about Magento or product adding to cart. If you need to introduce an extra check that the product is there - you need to add Response Assertion
In the absolute majority of cases the main reason for "failing" requests is missing or not properly implemented correlation of the dynamic parameters:
Check that your ${form_key} JMeter Variable has anticipated value using Debug Sampler
Your request URL looks very suspicious, it might be the case you need to extract the URL for adding this particular product from the previous response as well
Don't forget to add HTTP Cookie Manager to your Test Plan
Also be aware that there is a Magento performance-toolkit containing benchmark.jmx script which you can use as the reference/basis for your own tests
You likely need to handle the dynamic values associated with cart identifier with the session. I will save you some time however, architecturally when Magento issues the cart is a known antipattern - every time I see Magento it is a default cart model.
What does this mean, the "default cart...?" This is a pattern of too early allocation of a resource. Twenty percent or fewer of visitors will ever use the cart, yet 100% of the population are allocated carts. You now have cart objects and cart resources which are dead resource allocations in the system that have to be managed, which includes clean up after a period of time/time out.
The performant design pattern is a just-in-time cart which is only created when the use either adds something to the cart or selects the cart icon to view the contents of a stored cart. Going along with this, the number of items in a perpetual cart should be persisted in a local cookie value rather than require a "pull" of the cart every time the user visits the site.

Charge Payload different to Cart total (rounding)

I have isolated the reason why zip pay orders are cancelling on our system with the help of their support.
This is the response from the integrations team.
We have taken a look at the issue and it seems the issue occurs on your end and only when an order has 2 decimal places or more.
The reason the error is occurring is that there seems to be rounding on your end before we create the charge.
The reason this only affects Zip orders is that Zip checks to see if the order details match what is being passed to Zip and if it doesn't throw an error to ensure the customer is charged the correct amount.
Below you can see the product page which rounds to the nearest first decimal:
(product shows price as $2180)
​
And below you can see the cart page which doesn't round:
(shows price as 2179.98)
​
Zip takes the cart page information then compares this to the charge payload before creating the charge.
You can see below that the charge payload is rounded after the checkout which is causing the error:
(picture of code with charge as 2180)
​
You can also compare this to the checkout response below which has a different value:
(picutre of code with charge as 2179.98)
​
We aren't sure if there are any business rules applied on your end which is causing the behavior, however, the Zip plugin is functioning as intended.
I would recommend speaking to your developer as this doesn't seem to be the standard Magento rounding and it is causing the issue when charging the customer.
I am using OnePage checkout and can only think that this is the place causing issues.
Any suggestions on how to stop this from happening (ie stop it rounding after checkout on the charge payload)?!
I am happy to try anything.
Cheers
The answer to this was not simple. For some reason in our store the onepagecheckout was rounding to 4 places and the store was rounding to 2 places.
It was a matter of forcing all prices to round to one value. I ended up using an extension to achieve this and it worked. I know us zip, after, and paypal all in one happy environment.

Disable Auto-Invoice by Paypal in Magento

There is a choice of “SALE” or “AUTHORISATION” in the Magento Paypal settings. We ideally wish to stay with “SALE” as that covers 99.9% of anything we do (we always have goods in stock). The “Authorisation” option worries me with the 3 day limit, plus it adds an extra “capture” step that could go wrong later.
So…….
“SALE" works fine but in Magento it automatically creates an INVOICE in the system. Other payment systems we use such as Sofort AG make this setting optional and for a very good reason.
Magento is set so that once you have produced an INVOICE and a SHIPMENT it automatically marks any order as COMPLETE.
We create UPS labels, with a tracking number which of course is added to the SHIPMENT details. So my problem is:
As soon as we try to create a UPS label (without even printing) Magento sets the Paypal orders to COMPLETE. This is because it has seen an INVOICE
and a SHIPMENT for an order.
We need to disable a Paypal “SALE” from producing an invoice. We can easily produce and send the invoice once the shipment has been produced
and sent, and then set it finally to Complete.
Is there a setting I have missed to disable this forced invoice? I can see a company used to make a module for this purpose but it is out of date for Magento 1.9. (I did try it just in case!!)
http://www.magentocommerce.com/magento-connect/disable-automatic-generation-of-invoice.html
No, there is no setting to fix this: paypal create an object called transaction and this kind of object should be created with the object invoice. It's not a good practice to don't create invoice and I suggest you to stay away to any component that don't create a transaction.
Probably it works well, but in the flow of order creation when you will evalutate to play with order status. Anyway there is not a setting to do this.

Magento order with subtotal and grand total 0

I am observing the strange situation of orders with subtotal and grand total of 0, but with products in it. The products row have prices and no promo rules or discounts are being used. This happens sporadically and not only with one site. The version of Magento is 1.7.0.2. There are also no additional extensions installed. system.log and exception.log do not contain traces of errors that may have something to do with this problem.
At first i thought it may be because of server overload. I think this may have something to do with it but the last "0"-subtotal order happened when the server was not loaded at all.
Any ideas? Thanks!
I 've had the same problem with you guys and it was really annoying because I could not reproduce it and could not find a proper solution.
I started to believe that it was just another Magento bug caused by some bad timing in database operations.
Anthony's post really helped me and guide me to find a practical fix.
So here it is.
Indeed the error is caused by the trigger recollect flag that is set in markQuotesRecollect (for instance when a product is saved) and causes
all active quotes to recollect their totals.
I had to spent a lot of hours in debugging IWD OnepageCheckout code to understand that in Geo.php saveBilling function creates a new shipping address by cloning
the billing address (in case shipping is same as billing) and passes (almost) all data from billing address to the shipping address which later on is saved (through the parent quote save).
This way cached_items_* data are set and when Geo.php saves payment even if you intentionally set quote to recollect totals (i.e by setting collected flag to false) shipping totals
are not calculated correctly.
Eventually I had to add this lines of code in saveBilling method after line that writes:
$ship->addData($bill->getData());)
$ship->setSameAsBilling(1)->setShippingMethod($ship_method)->setCollectShippingRates(true);
$ship->unsetData('cached_items_nominal');
$ship->unsetData('cached_items_nonnominal');
$ship->unsetData('cached_items_all');
So far (after 10 days and around 1000 orders) had no random zero total orders.
Hope this helps you all
Kind Regards
Lefteris
I have had the same problem. And I have done some researches here.
I used IWD onepagecheckout module. And the issue was inside this module.
Lets consider situation. You are doing smth in adminpanel or cron is doing some tasks this products or you could apply some catalog rules. In any kind of these actions will be called event catalog_product_status_update or catalog_product_save_after.
So every time you're changing smth in products all current quotes will be updates by events.
ok, here you'll ask me - what does it mean?
It means that each quote changes the field trigger_recollect in sales_flat_quote table.
You can find it here
app/code/core/Mage/Sales/Model/Resource/Quote.php::[markQuotesRecollectOnCatalogRules and markQuotesRecollect methods] to get more in details.
The trigger_recollect field is a trigger/signal to recollect whole quote total sums. You can find this step here
app/code/Mage/Sales/Model/Quote.php::_afterLoad.
protected function _afterLoad()
{
// collect totals and save me, if required
if (1 == $this->getData('trigger_recollect')) {
$this->collectTotals()->save();
}
return parent::_afterLoad();
}
And accurate at this moment all current quote total sums became 0. The follow step is to get address collection and for some reason we have not product items it the address object now. Magento cannot recollect correct here. But it occur only when you or system are doing smth with a products and at the same time customer is pressing the button "send order". Why - I do not know yet. By the issue was occurred and catched.
Just check in the Configuration->Advanced->advanced->Disabled Module Outputs
Mage_Tax option is enabled or not.
Zero Subtotal Checkout
Using this
System > Configuration > Payment Methods > Zero Subtotal Checkout
More info to go hear

Magento - Splitting an order into 2

I am trying to make a functionnality so that a customer will be able to split his order into 2, in case some articles are temporarily unavailable and if they wish that we send them part of their order first. So the idea is to create 2 new orders and cancelling the old one.
Do you have any idee about how to do this programmatically please ?
What you're describing doesn't sound necessary... You're talking about sending part of the order first... Notice in the Magento Admin once an order is place you can create an invoice, take note that you do not have to invoice everything at one time, the same is true when you create a shipment. You'll need to make sure you're merchant / payment gateway supports multiple partial captures against a single authorization.
However, if you really want to split the orders in two, it is a rather complicated process. We've done it, and its very tricky... you need to modify the opcheckout.js file, you'll need to modify the template since you will have to create seperate shipping methods for each order. You'll need to modify the OnePage controller & Model files very significantly. There are tricky areas in terms of re-executing the totals and making sure data on the order and subsequent quote and address models is precisely what is required by Magento. Maintaining the other checkout functionality requires diligence, such as saving the customer's address when checking out. If you're really going down the path of coding something that splits an order into two orders during the checkout process, feel free to send me a message and we can talk more in-depth and I'll send you some code.

Resources