Magento: Auto Add Gift Certificate to Cart Every $X Amount - magento

We have a website that we are trying add a gift certificate to the cart for every $100 someone spends (i.e. a customer gets a $10 gift certificate for every $100 they spend). We are currently using Magento 1.6.1 and Unirgy Gift Cerificate to do our gift certificate system. Does anyone have a better solution or a way to use our current system to do what we want?
I have looked into a whole bunch of Add to Cart extensions, but all of them don't seem to allow me to add a gift certificate to the cart.

the extension is paid so I cannot help you much here but: If you know how the gift card is added to cart (check extension code to find out) you could try adding observer using 'checkout_cart_product_add_after' event. On how to add events, check here:
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method
In the observer method, check how much $$$ the cart does have by getting quote e.g:
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
and gathering grand total (getGrandTotal metod I guess)
and add as many coupons as you would like ($total/100 = $gifcard_amount) and then reuse the code by using
for ($i=0;$i<$giftcard_amount;$i++){
//giftcard add logic
}
Hope this will get you started.

Related

Magento create personal coupon to newsletter

With Magento version 1.7, how can I auto generate a personal 10% discount coupon for each newsletter receiver that can only be used once by that specific account/user?
Here is an idea. Actually 2 of them.
The quick one.
Create a coupon with your desired rules, set the number of uses to 1 per customer and unlimited for general usage and hard code the coupon code in the newsletter email.
Estimated time: 30 minutes including tests. Risk: minimum.
The slow but clean one:
Create an observer on the newsletter_subscriber_save_before or newsletter_subscriber_save_after that checks if the customer subscribes and if so, it creates a coupon with your desired settings. See this for creating coupons by code.
Then rewrite the method Mage_Newsletter_Model_Subscriber::sendConfirmationSuccessEmail so you can pass that code as a parameter to the e-mail template.
Something like this:
$email->sendTransactional(
Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
$this->getEmail(),
$this->getName(),
array('subscriber'=>$this, 'coupon_code'=>THE COUPON GENERATED IN THE EVENT)
);
Then modify the newsletter subscription e-mail template to include this:
Your coupon code is: {{var coupon_code}}
Estimate 4h-8h. Risk: "not that minimum".
I would take the first approach.
Use personal discount extension http://www.magalter.com/personal-discount.html to generate 10% discount coupon. You will be able to choose customers who can use this coupon.

Magento Free shipping ONLY on standard shipping

I am having no problems setting up free shipping for certain items with shopping cart rules. However, it being Christmas time, I want to offer free shipping on standard shipping, but leave Express shipping at it's regular price. When I setup the shopping cart rule to give free shipping to a specific item it automatically reduces every flat rate shipping method to $0. Is there a way around this?
Please check the screenshot it might help you.. here regular is the shipping code for Standard shipping and i have added extra condition if order amount is more than $100.
Best of luck, Let me know if you have any issue.
I had a similar problem and I found a solution.
The Problem: Multistore website with multiple shipping method: flatrate, matrixrate. In some store the free shipping rule should be applied only to matrixrate and not flatrate, in some others should be applied to flatrate.
The Solution: Use the rule like explaned here with whatever condition but the shipping method one. Then create a module that extend the Flatrate model (or the one witch shouldn't be affected by the rule) for prevent to apply the shipping rule according to a configuration specific for website.
More info here: https://magento.stackexchange.com/a/173063/4647

Magento get chosen shipping and billing method address fields

How can I get the choosen shipping and billing fields during checkout? (I want to show them in sidebars)
I use this in shipping.phtml but ofcourse that's just for the current 'address' (and I want to use it in methods.phtml and other pages)
$this->getAddress()->getFirstname()
So I assumed that this would work out...
Mage::getSingleton('checkout/session')->getShippingAddress()->getFirstname()
But it didn't, anybody has a tip?
Addition:
This one was helping me a lot, but I'm stuck :-S
How do I get the shipping method the user has chosen during checkout?
Shipping and billing addresses are children of quote object. So something like this shall work:
Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getFirstname();

Magento: don't send tax to paypal/don't show tax in paypal emails

I'm using magento 1.7, and one of the payment options is Paypal (UK) express checkout.
The problem is that I don't want paypal to send out emails with any tax breakdown on, is there a more straightforward way of solving this (at the Magento or Paypal end) rather than hacking the core module to pass sub+tax as sub and 0 as tax?
I can see that a lot of the fields are mapped in Model/Api/Nvp.php, but can't immediately see where I'd modify these values.
As far as I investigated, there is no easy configurable way to prevent taxes to be submitted to Paypal.
But indeed there is a core hack if you don't mind that only the total amount is submitted (no line items, no taxes).
Go to System/Config/Paypal and set Transfer Cart Line Items to No.
In your code go to function _validate() in class Mage_Paypal_Model_Cart.
At the end of this function add the following lines:
$this->_areItemsValid = false;
$this->_areTotalsValid = false;
Of course it is nicer to to rewrite this class in your app/code/local folder.

order approval for magento

I ’m in need of setting up approvers for orders that customers submit.
There is no credit card authorization required. For example, an employee from a company puts foo and bar into their shopping cart and checks out. One of the employee’s bosses need to approve it (the superiors will have accounts in magento already) before they can be invoiced. So when an order is placed, an email needs to go to the bosses, with a URL to the order. Then they can accept it or decline it.
Is there an existing extension that does something like this or would be a good starting point?
Yep, there is. :)
Check out the free ZetaPrints Order Approval extension. I have experience with it and it does exactly what you want. ;)

Resources