Jump to content

Product.tpl, "buy-block" modification.


Recommended Posts

Hi I'm tryging to modify my product.tpl, section "<!-- add to cart form-->". To create something similar to this: http://www.avilo.pl/pl/23-roll-up-standard-100x200-9000002.html

 

I have definied combinations for my product. Atributes for product are set to single-selection buttons.

{elseif ($group.group_type == 'radio')}
    <table style="border: 1px solid black;">
        {foreach from=$group.attributes key=id_attribute item=group_attribute}
            <tr style="border: 1px solid black;">
                    <td style="white-space:nowrap;">{$group_attribute|escape:'html':'UTF-8'}</td>
                    <td style="white-space:nowrap;">
    
                            <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>
                   
                    </td>
                    <td>
                        <span>ilość: </span>
                        <p id="quantity_wanted_p">
                            <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" />
                        </p>
                    </td>
                    <td>
                        <div class="box-cart-bottom">
                            <div{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE} class="unvisible"{/if}>
                                <p id="add_to_cart" class="buttons_bottom_block no-print">
                                    <button type="submit" name="Submit" class="exclusive">
                                        <span>{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</span>
                                    </button>
                                </p>
                            </div>
                            {if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}<strong></strong>
                        </div> <!-- end box-cart-bottom -->
                    </td>
                  
                
                <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} />
            </tr>
        {/foreach}
    </table>
{/if}

I don't know how to display proper price for each attribute.

 

If I remove input type radio, then It shows that product Is unavailable.

 

Buttons "Add to cart" (Dodaj do koszyka) should get quantity value only from cosest input and then add selected product to cart.

 

How to resolve my problem? Is there exists some plugin for this ?

 

In attachemen I was added image of my actual progress.

post-903877-0-79674700-1424877421_thumb.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...