Magento trigger shipping by custom option - magento

I have a downloadable product in the Magento catalog. This have a custom option attached to let the user decide if he want to receive the physical copy of the product.
The problem is that magento disable shipping address for every downloadable product. I searched a lot for a solution to this and the general suggestion is to create one downloadable product and one normal product but I really don't want to do that as I have tons of products and it would be hell to manage the catalog.
Can anyone tell me if this is in fact possible to do in magento and if it is possible, point me in the right direction on how to apply the modification to the shipping handling classes?

One way to do this is to overwrite the isVirtual() function within:
app/code/core/Mage/Downloadable/Model/Product/Type.php
When the custom option is selected (and only then), it should behave like:
public function isVirtual($product = null)
{
return false;
}
Checkout will then act like with normal products and request for shipping options.

Related

Eedit order and shipping methods in Magento 1.5

When I'm editing order in Magento 1.5 in shipping method section there is a list of all available shipping methods. But when I change number of products or add/delete any product, all shipping methods disappear. Instead of shipping methods there there is a link: Get shipping methods and rates, but when I click it nothing's happend - page reloads and still there are no methods.
I have no messages in logs, where I can check what is wrong with it?
When you edit any order from the magento admin, magento will cancel that particular order and will generate a new one with the new order ID. Example if you have order ID 1234567, by editing this a new order will be generated with the ID 1234567-1
So once a new order is created from admin or updating products in existing order you will get a link called Click to change shipping method . Because shipping methods are dependent on products selected and shipping address provided in shipping address fields.
Now as per the issue you listed that you are not seeing any shipping methods after clicking link. This may arise with the following reasons.
You may not have shipping methods available as per the products rules (quantity, weights, product price etc).
you may be putting downloadable product which do not require shipping details
Another possible reason is that you might have missed shipping address fields.
you may have any shipping restrictions plugin installed that may applying any restriction rules.
You may have any java script error in you console. Which is stopping ajax to be completed after clicking the link. (check your browser console window)
You can debug it by your quote object. Try to get your quote object and see what are the information missing there. Is products are their in your corresponding quote objects ? is shipping details are there ?
If you still need any help in debugging let me know I will help you.
It sounds to me like you have a shipping extension installed? And/or an order editing module? The interaction between shipping modules and orders is precarious at best; developers cannot forsee the varied interactions which occur on our websites.
We just discovered MageWorx Extended Orders module. Amazing and reliable. Their overloading of the sales order grid as well as the order view is a great integration, combining order editing, custom shipping rates, allowing customized columns in the sales grid. And the module's price is very fair.
Previously, we used TinyBrick True Order Edit in concert with another module for custom shipping rates but they did not play well together... often with the same result you are seeing. Possibly the instability then was that TinyBrick tries a more focused overload of the order view.

what type of products should be used to achieve the below mentioned functionality in magento?

I want to implement the functionality in magento, the link of this is below :
http://ledflashingwatch.com/clocker-watch-illuminati-series/
when you click on strips, it changes strips image but when click on dial, it changes separately. And also add to cart will differentiate the product on these two values.
Can anyone advise me on how to proceed towards approaching this idea. And which type of products to use for this.
You can ask me questions if it's still not clear to you. And do tell me if it is not possible.
This feature is not available in Magento out of the box.
There are several possible approaches, but the user interface component will have to be custom built by you.
If you want the selected products to appear separately in the cart (like in the example you linked) choose simple products.
You could also use a grouped product with a custom interface.
If you want them to be added to the cart as a single product, but internally they are separate, use a configurable product. This is the option I personally would prefer.
You could also use a bundled product - It all depends what exactly you need.
I suggest first getting a good idea of the differences between the product types. Then study how they are reflected in the quote as quote items, i.e. visibility, parent and child items etc.
Once you know that, the implementation will be rather straight forward.
Build the UI. Build the request parameters for the add to cart call. Done.

Magento put single product in catalog mode

i have a Magento shop and want to do the following:
Some of the products should not be available for buying (they should be put in some kind of catalog mode).
How could this be achieved in Magento?
Make some custom attribute for those products. For example:
can_sale
And on frontend display add to card button depending on this attribute. Like this:
if($product->getCanSale() == 1){
/*Display add to cart button*/
}else{
/*Dont' display add to cart button*/
}
The above answer works, but is a template solution for something that (in principle) should be solved server-side.
If any of your visitors is savvy enough to construct an add-to-cart URL, they can still add products you hid the cart button for, to their carts. Probably a very minor problem of course, in this case.
There's an extension called Not2Order, don't know if I'm allowed to link it here. That extension takes care of enabling / disabling the ordering of products from the server side, which is a little more robust.

Pulling Custom Option ID from Magento

We have a SOAP connection to magento that is working great - we're able to pull product info, skus, descriptions, etc. using the magento API. We've been able to successfully add products to the cart programmatically with custom options, and that works great. The problem is this:
When you create a custom option for a product, it is assigned a unique ID that has to be called in order to pass that option value to the cart. For example:
www.mysite.com/magento/checkout/cart/add?product=7&qty=1&options[OPTION ID]=robots
Assuming I have my custom option ID correct, this will add 1 product with the option "robots." Which is nice.
However, we have hundreds of products, and while they all use similar custom options, each option is given a unique ID. That means I need to be able to call the magento API and get custom options details (specifically the option ID) so that we can add them to the cart properly. I have been back and forth with Varien Support (Magento), but they are less than helpful, as usual. Now, I know I can find these options by using firebug in Firefox or Chrome, which I've done to test the "add to cart" script. However, that's not a proper solution. I need to be able to grab this data from magento based on product id.
Can this really be that hard? Shouldn't this be tied to the data for the product somehow? I've done a var_dump on the catalog_product.info and i see where it asks if there are options but doesn't provide any details on them. Thoughts?
Thanks in advance.
Do you need to get all options ids for specific products or just some particular? For the latter you can use this code:
$productEntity = Mage_Catalog_Model_Product::ENTITY;
$colorAttribute = Mage::getModel('eav/config')->getAttribute($productEntity, 'color');
$colorAttribute->getId();
For the first option code in this question might be useful How to get all super attribute options for a configurable item in Magento

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