Magento: adding catalog price rules to options of a bundle - magento

I've looking around and couldn't find how to do this.
I'd like to be able to set a catalog price rule for a specific option of a bundled product. Basically I want to set the price of any selection from option1 to be $0 in that bundle (but keep the price the same for that product if someone just adds the product to their cart from outside of the bundle). is there a way to do this that i'm missing?
The second approach I was thinking was to set the price to $0 of all those selections for that option (i saw a post on here on how to do something like that programatically) although without testing that that works, it seems like it wouldn't.
any ideas would be welcome.

This is something that Magento does not do by default. Additionally, beware of trying to change this through cleverness, as Magento has significant validation for prices once items are added to the cart (e.g. it will try to recalibrate them to the database on every page load). It sounds like trying to restructure the flow so that you aren't trying to use the shopping cart rules might be the best bet here. Would it be possible to use some other mechanism to give discounts, like a coupon code?

Related

Shopify Script for Fixed Discount of a set price based on tags

Using Shopify Scripts :::
I am trying to achieve the below but getting issue. Could you please let me know how to do this.
$25 off a purchase of $125 or more from the "sale" section. These products have a tag "sale" and are also in a collection "sale" based on that tag.
Looking forward for your quick response.
Great Thanks
If you examine the documentation for Shopify Scripts you'll notice that there is no support for auditing the line item for tags. So you should try the other approach which is proven, and works well.
Look for an item with a compare at price. If you find one, then that typically means the item is on sale. So you can rig your logic to look for items with a compare at price, and if they have one, then determine if the cart has exceeded the $125 in value, and if so, apply your discount.
I can't give you the exact code as I don't know the structure of your code. But this is what you need to do.
Wherever a product can be added to the cart assign a JavaScript function to check if the product is of "Sale" collection. If yes, add an attribute cart.attributes.something.something and keep changing it as and when required.
When the checkout mechanism is present in the page, and if your conditions satisfy the Sale discount, take then to /checkout?DISCOUNT=<CODE> and click of checkout. It'll automatically apply the discount.

Magento - Uses and Benefits of getOptionsByCode

I have seen that Magento uses this method "getOptionsByCode()" in the class "Mage_Sales_Model_Quote_Item" a lot, for retrieving / fetching the Quote Item options by code. After printing each of the Options, for any item, I found these:-
info_buyRequest
option_ids
option_1843
attributes
product_qty_231
simple_product
Now here are my questions:-
What Magento is trying to achieve with the use of this method "getOptionsByCode()", or its benefits?
Is this only to be used for the Configurable Products, or for other composite Product Types also?
How to determine which option codes are for Custom Options of the corresponding Product Item?
What are the options "info_buyRequest" and "simple_product" specifically used for?
Are there any other uses of the Custom Options, like Configurable Attributes or something else?
Thanks to all in advance!
Let's answer one at a time:
The item's options are the values the user selected for adding that product to the cart (for instance, the different options and their selected values).
All of the products use at least the info_buyRequest option. I don't really know about the other ones.
I think they might be all inside of the "attributes" option, but I never really used custom options.
info_buyRequest is used to spec the qty, and all other options. It is the initial request (that later gets processed). The simple product probably is the real product you are adding to the cart (that is, the item might be a configurable product, but you add in the cart a simple product).
I don't really know. But, if what you need is to find out the options chosen for such product, my guess is you should check either the "attributes" option, or just get the simple_product and get it's options.

Magento: Shopping cart price rule gets applied, but discount not subtracted from subtotal

I have created a shopping cart price rule in my Magento store (version 1.4.1.1), and it seems to get applied without issue on the frontend, but the discount isn't actually reflected in the subtotal or final total. The original item price is $45.00, and the discount should be $35.00, making the final price $10.00. Here are some screenshots of the setup. (Sorry, because I'm a new user it won't let me post images directly in this posting.)
http://imgur.com/a/hdYDb
Main rule page
Actions page
Cart showing that promotional code was applied
Reviewing order (last step before submitting order)
This particular item has some custom options set, which set the pricing for four individual options. The price for the product is $0.00, and then each option has it's own price (I didn't set this part up, so I'm not sure if I'm missing something from here too). Here's a screenshot of the product custom options page: http://imgur.com/uO9HG
Any thoughts? I'm fairly new to Magento, so it's possible I'm just missing something obvious. Thanks in advance for any help or guidance!
I actually JUST figured out what was going wrong, or at least, I figured out a solution, though not sure exactly why this was affecting the shopping cart price rules. You're right that I wasn't even able to get a simple price rule to work - it simply wasn't working no matter how I changed the rule. Anyway, while working on another issue, I realized that I was missing the Subtotal/Grand Total box on the front-end of the shopping cart (I installed a clean copy of version 1.4.1.1 on my localhost, which is when I noticed it was missing from my live site). When I re-enabled the Subtotal/Grand Total box, the rules started working again. (I suppose now that Magento has a place on the front-end to show the discount, it actually applies it, whereas before it would just do nothing.)
So, to re-enable the subtotal/grand total box, in the back end, I went to System > Configuration > Advanced > Enable the Mage_Tax module. Again, not sure why it was disabled in the first place, and I'm not sure if this affects anything else on the site, but it's been up for awhile now and I haven't noticed anything awry. Here's a screen capture of it working: http://i.stack.imgur.com/kjl6S.png
I think the problem comes from using SKUs with your custom options combined with restricting your price rule to the product SKU. Magento combines them using a hyphen - place a test order to see if this is the problem.
The SKU in a test order I made comes out something like this;
[ORIGINAL_PRODUCT_SKU]-[CUSTOM_OPTION_SKU]
At least, that's the result I'm getting from version 1.5.0.1
The quickest solution I could find was to match the rule on the product url key rather than SKU. It isn't the most intuitive solution, but since you wouldn't change the URL on the product (I hope), it will work where SKU's with custom options fail.
In version 1.4, the URL key should be available to choose instead of SKU already. So you can just select url key instead of sku and insert your product's correct url key in your shopping cart price rule. Just replace "SKU is ..." with "URL key is ..." inserting the correct url key for your product.
In version 1.5 I had to enable "Use for Promo Rule Conditions" on the url_key attribute like this;
Log in to Magento admin area
Navigate to Catalog > Attributes > Manage Attributes
Locate the Atrtibute Code "url_key" and click to edit it
Change "Use for Promo Rule Conditions" to Yes
Save the changes
you may need to reindex the Product Flat Data index at this point
Then I could use it in my price rule.
Had this same exact problem on CE 1.9 running PHP7, applying the Inchoo "PHP 7 compatibility extension for Magento 1" solved the issue!
https://github.com/Inchoo/Inchoo_PHP7

Using one stock for multiple items in Magento

Ok so what I want is to have multiple simple products draw from the same stock.
Scenario
I have a sinle nail file (Stock:500)
I have a box of nail files (50/box)
I want it so that if someone buys a box then it deducts from the 500 stock of the singles. Essentially what we do is if someone buys a box, then we ship them 50 of the single files in a box.
Any easy way to do this?
This isn't a native function of Magento, so there a few approaches you can take to emulate it:
Use an external stock management package to keep track of stock and modify Magento to use that. This will require more backend modification.
Attempt to fool Magento by using product bundles in clever ways. This will require more frontend modification
Develop or find a Bill of Materials plugin for Magento. I didn't see anything after a short search, so you may have to build it. Have that module check the constituent materials for a product before allowing it to be added to the cart.
Hope that helps!
Thanks,
Joe
Consider:
Create a template for the products that you wish to order this way. This template need only be the files you need to modify, by default it will find the missing files from your default theme;
In the template you can place some PHP to write out some extra javascript, of the prototype variety;
This frontend code hides the real quantity box, with prototype 'hide' for the relevant css id to make it a hidden form field;
The code shows its own quantity box, also an extra field for how many of the fifty packs are required;
An onchange event on these boxes gets the values of the boxes, does the required multiplication and addition, then updates the hidden 'real' quantity box with (boxes*50)+singles;
On submit the customer sees in the cart the total quantity of the product ordered - this will be total units, not broken down 'per box'. If this is a problem, you can put some words to explain that or modify your main template to handle this and present to the customer the boxes+singles breakdown;
Set your products to use the 'new theme' that has your template update code.
Test, test, test!
As mentioned by Joseph this cannot be done out of the box. The above workaround is only partial, however, so long as you make it clear to customers that they are buying 500 units instead of 500 boxes then you should have a reasonable solution.

Magento: Configurable products without setting up each simple product?

I need to set up hundreds of products, each of which need an drop down that has from a few to twenty or thirty options so I refuse to use configurable products to set these up. I just want a product to use all the options in an attribute.
For example, I want to let customers pick from colors and sizes for a product, but I don't want to have to individually create products for each option. The pricing is the same for everyone and I don't need to track inventory for the options, so there's no benefits in using configurable products.
Is this possible?
Either use simple products and utilize the custom options tab (you will not be able to track inventory of each variant if you go this route). I have seen a number of ways to do this programatically via magento's product creation API or custom code. There is also a number of extensions that make it easier to to do but they do not fully automate the process. One of the automated ways to do it very fast can be found here.
The tutorial is setup exactly the way you want (color & size). Once you create this page make sure you are logged into the admin and open it with your browser. It will work it's magic.
Here are most of the extensions that do it, but they are not as automated as the custom coding methods such as the one linked above:
Product Creator
Automatic Configurables
Better Configurable Products
Perhaps instead of configurable products you could use simple products with custom options instead. There are even ways of importing products with options intact, most of the work is done by copy & paste in a spreadsheet which is much quicker.
If you're looking for a more programmatic way of doing things then you might think of making a custom product type which adds the same options every time so you never need to specify them again. Modifying the product type would modify all options at once too.
Yes, this is possible, just make attributes and note that this is a programming forum, for general questions head to magento forums
Simple product with custom option is not === configurable product as each option do not have Magento stock control, as you can never say Size "Small" sold out as there is no stock for options, that is the main reason why Magento has to use simple product to be the option of the configurable product as simple has stock.
If you have unlimited stock then using simple product plus custom option is the best solution for performance.

Resources