Milople Inc
Milople Inc

Reputation: 399

How to generate downloading link using custom option ID for various products that are available on website for Magento?

I want to fetch the custom option ID for the Magento Product to generate the different downloadable link in Magento.

I have three custom options in the One product.

option 1: free

option 2: paid

option 3: both

If I select option 1 then it will allow me to download free version of the module. If I select option 2 then it will allow me to download paid version of the module. so on..

Thus, I want to add different download link for different options, which on click will proceed for the checkout according to the specific custom option selected.

Upvotes: 0

Views: 376

Answers (1)

Cobolt
Cobolt

Reputation: 952

I've implemented something similar to this (see here)

<div class="styled-select">
<select name="options[22]">
    <option value="57">SA Postal (Free)</option>
    <option value="56">Registered Mail (+ R22 pm)</option>
    <option value="53">Door to Door (+ R30 pm)</option>
</select>
</div>

Now go to the admin panel (back end) and select catalog -> Manage product. Select the product you are making the custom links for. Go to Custom Options. You will find that if you 'inspect element' or view the page's source code:

<tr id="product_option_22_select_53"><td><input type="hidden" name="product[options][22][values][53][option_type_id]" value="53">

You will see that you just have to match these values. options[22] is which option and 53 is the value for 'Delivery Type' and 'Door to Door' in this case.

Just look at a product page to see how the form on a product page looks (catalog/product/view) and take a look at the product options while you're at it.

Upvotes: 1

Related Questions