Magento & Google Checkout & Tracking - magento

I am attempting to integrate an afilliate network with my Magento shopping cart. I am using Google Checkout so i need to modify app/code/core/mage/googlecheckout/model/api/xml/checkout.xml in order to pass some tracking info to Google Checkout.
So far I have this code:
<merchant-checkout-flow-support>
<parameterized-urls>
<parameterized-url url="https://track.webgains.com/transaction.html?wgver=1.1&wgprogramid=4449&wgrs=1&wgeventid=7041&wgvouchercode=XXXXX"/>
<parameters>
<url-parameter name="wgorderreference" type="order-id"/>
<url-parameter name="wgvalue" type="order-total"/>
</parameters>
</parameterized-urls>
....
</merchant-checkout-flow-support>
Does anyone know how I can replace the 'XXXXX' with the name of any discount code which has been used?
Thanks!

I'm guessing here, but have you tried adding a new attribute to the Order object called (say) order-voucher-code (this forum thread gives you that process), and then inserting:
<url-parameter name="wgvouchercode" type="order-voucher-code"/>
That might work?

Related

Orders with paypal not listing on user dashboard

I have a magento website and I have a problem.
In the user dashboard the orders via Paypal are not listing, it just show a message:"you don't have any order yet", but the orders via cc or other one works perfectly.
I've been exploring sales.xml but I haven't been able to find what can be the cause or how to fix it.
Thank you for your kind help.
It took me a while to figure that out. The problem is not with Paypal but with the order status "Pending Payment".
In the file ../Mage/Sales/etc/config.xml find the block that describes the Pending Payment order status and add this line:
<visible_on_front>1</visible_on_front>
If you are not sure where to put it just look the rest of the order statuses and see that all of them have the visible_on_front attribute set to 1.
Your code block should look like this:
<pending_payment translate="label">
<label>Pending Payment</label>
<statuses>
<pending_payment default="1"/>
</statuses>
<visible_on_front>1</visible_on_front>
</pending_payment>

magento ups shipping api

I want to calculate shipping rate using UPS api in magento.
I will pass lenght, width, height and zipcode the UPS api will return shipping rate for that product.
I got the UPS rating API that will calculate the shipping rate from the below url after you login.
https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US
The development guide shows we can implement this using xml or SOAP call.
Can anyone tell me how exactly can I implement this in magento if
possible explain it at coding level.
You dont need to code your own api access. Just use the ootb UPS core extension.
Goto class Mage_Usa_Model_Shipping_Carrier_Ups
Goto line 907 (something like that) and change the part from
<Package>
<PackagingType><Code>{$params['48_container']}</Code></PackagingType>
<PackageWeight>
<UnitOfMeasurement><Code>{$r->getUnitMeasure()}</Code></UnitOfMeasurement>
<Weight>{$params['23_weight']}</Weight>
</PackageWeight>
</Package>
to
<Package>
<PackagingType><Code>{$params['48_container']}</Code></PackagingType>
<Dimensions>
<UnitOfMeasurement>
<Code>CM</Code>
</UnitOfMeasurement>
<Length>30</Length>
<Width>30</Width>
<Height>30</Height>
</Dimensions>
<PackageWeight>
<UnitOfMeasurement><Code>{$r->getUnitMeasure()}</Code></UnitOfMeasurement>
<Weight>{$params['23_weight']}</Weight>
</PackageWeight>
</Package>
Just use some variables to change 30 to whatever you want. It works, i tried it!
Good luck!

Magento DHL module, what it's supposed to do?

Should be an easy-to-find info, but I wasn't able to find any doc page explaining what the DHL module can do and what cannot. Specifically:
can automatically create the shipment? (I mean, in such a way that whenever an order is placed - w-and ithout any action by me - someone at DHL will be notified that there's a box to be picked up at my company to be shipped...)
can automatically create the tracking number and send it - via email - to the customer
or all it can do is just getting quotes?
No, and No. What it does do is allow for you to get, display, and record rates for the various shipping options.

Virtuemart Coupon Plugin based on quantity not value

I've had a look at available Virtuemart plugins and I can't find anything close to what I am after. This is what I need.
Allow admin user to create coupon codes. An import feature would be nice as there will be thousands but I can handle this bit if needed anyway.
The admin user selects the number of products the customer is allowed for each coupon code.
When the customer uses the coupon code they are allowed to choose any product on the website up to the total amount of products issued to the coupon. Regardless of the products price.
Nice extra would be to allow free shipping with the coupon.
I've looked at the possibility of extending virtuemart and I think it would be possible. It would however require quite a lot of changes and if I can find something that is halfway there it would help me on my way.
Thanks in advance.
OK well time was running out and I didn't get an answer so I rolled my own. It was actually fairly painless. I can't release the code but I can give you a good idea of the steps and a direction to go in.
extend vm_ps_coupon and override the update, add and process methods. Add and update should only require a change to the array that is sent to the DB. See here for more info on extending classes
Alter the enum in the database to allow for quantity as well as total and percent.
Within your new update method handle the variation of quantity to do as you need.
In the update method you can also set a flag for free shipping in a session variable.
In templates/checkout edit list_shipping_methods.php. Simply check for the free shipping flag and load the free_shipping class. You can then call free_shipping->list_rates($vars);
extend vm_ps_checkout, override the add method, call the parent add method and then check the result so you can delete the session variable for the free shipping.
Finally you will need to make some changes in the HTML. Unfortunatly i could not find a way to override this easily and since its only two small changes to the markup i just went ahead and hacked the core. If anyone knows of another way that would be great? I did see something online about using a Joomla hook and a System plugin but I'd rather keep it reliant on Virtuemart only.
In administrator/components/com_virtuemart/html/ edit coupon.coupon_form.php to show the new quantity radio button.
Then edit coupon.coupon_list.php to display the correct values. Currently it will only display percent and total.
Hope this helps someone in the future. If you need some assistance then post on here and I'll be happy to help.

Relate cheet sheet with event/observer?

Explain the relation between Magento Event/Observer Hooks Cheat Sheet?
List item ?
Example: is for "Submit invoice". (Sales/ order / new invoice).
I have to relate observer or automated the payment process. Once successful payment is done (by any online payment method). i have to take order id+ customer id & put that in my custom table named JOB.
Note: i felt observer will be the best option instead of extending class. Suggestion are welcome
after googling through this i came to conclusion that we have to execute grep -R dispatchEvent, this can be app or local or any other folder or all.

Resources