David Posted July 25, 2018 Share Posted July 25, 2018 Hola. Me gustaría saber como puedo hacer, para que a la hora de pagar, en la página del checkout. En el paso 4 de transportistas, aparezcan los transportistas como un desplegable y no como ahora en "radio", que has de seleccionar. El motivo es que va a tener 20 empresas de transportes y ocupa mucho espacio. ¿Alguien podria ayudarme? mediante código o si sabe de algún módulo de pago. Adjunto imágen para que sepáis a lo que me refiero. Uso la versión PrestaShop v1.6.1.19 Stable Gracias y un saludo a todos. Link to comment Share on other sites More sharing options...
David Posted July 25, 2018 Author Share Posted July 25, 2018 He encontrado la solución, por si a alguien les ayuda en un post: https://www.prestashop.com/forums/topic/271325-display-carriers-as-dropdown-list/ Para simplificarlo lo hice de la siguiente manera: En themes/xxx(en mi caso default-bootstrap)/ordercarrier.tpl Buscar esto: <div class="delivery_options"> {foreach $option_list as $key => $option} <div class="delivery_option {if ($option@index % 2)}alternate_{/if}item"> <div> <table class="resume table table-bordered{if !$option.unique_carrier} hide{/if}"> <tr> <td class="delivery_option_select"> <input id="delivery_option_{$id_address|intval}_{$option@index}" class="delivery_option_radio" type="radio" name="delivery_option[{$id_address|intval}]" data-key="{$key}" data-id_address="{$id_address|intval}" value="{$key}"{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} checked="checked"{/if} /> </td> <td class="delivery_option_logo"> {foreach $option.carrier_list as $carrier} {if $carrier.logo} <img class="order_carrier_logo" src="{$carrier.logo|escape:'htmlall':'UTF-8'}" alt="{$carrier.instance->name|escape:'htmlall':'UTF-8'}"/> {elseif !$option.unique_carrier} {$carrier.instance->name|escape:'htmlall':'UTF-8'} {if !$carrier@last} - {/if} {/if} {/foreach} </td> <td> {if $option.unique_carrier} {foreach $option.carrier_list as $carrier} <strong>{$carrier.instance->name|escape:'htmlall':'UTF-8'}</strong> {/foreach} {if isset($carrier.instance->delay[$cookie->id_lang])} <br />{l s='Delivery time:'} {$carrier.instance->delay[$cookie->id_lang]|escape:'htmlall':'UTF-8'} {/if} {/if} {if count($option_list) > 1} <br /> {if $option.is_best_grade} {if $option.is_best_price} <span class="best_grade best_grade_price best_grade_speed">{l s='The best price and speed'}</span> {else} <span class="best_grade best_grade_speed">{l s='The fastest'}</span> {/if} {elseif $option.is_best_price} <span class="best_grade best_grade_price">{l s='The best price'}</span> {/if} {/if} </td> <td class="delivery_option_price"> <div class="delivery_option_price"> {if $option.total_price_with_tax && !$option.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))} {if $use_taxes == 1} {if $priceDisplay == 1} {convertPrice price=$option.total_price_without_tax}{if $display_tax_label} {l s='(tax excl.)'}{/if} {else} {convertPrice price=$option.total_price_with_tax}{if $display_tax_label} {l s='(tax incl.)'}{/if} {/if} {else} {convertPrice price=$option.total_price_without_tax} {/if} {else} {l s='Free'} {/if} </div> </td> </tr> </table> {if !$option.unique_carrier} <table class="delivery_option_carrier{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} selected{/if} resume table table-bordered{if $option.unique_carrier} hide{/if}"> <tr> {if !$option.unique_carrier} <td rowspan="{$option.carrier_list|@count}" class="delivery_option_radio first_item"> <input id="delivery_option_{$id_address|intval}_{$option@index}" class="delivery_option_radio" type="radio" name="delivery_option[{$id_address|intval}]" data-key="{$key}" data-id_address="{$id_address|intval}" value="{$key}"{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} checked="checked"{/if} /> </td> {/if} {assign var="first" value=current($option.carrier_list)} <td class="delivery_option_logo{if $first.product_list[0].carrier_list[0] eq 0} hide{/if}"> {if $first.logo} <img class="order_carrier_logo" src="{$first.logo|escape:'htmlall':'UTF-8'}" alt="{$first.instance->name|escape:'htmlall':'UTF-8'}"/> {elseif !$option.unique_carrier} {$first.instance->name|escape:'htmlall':'UTF-8'} {/if} </td> <td class="{if $option.unique_carrier}first_item{/if}{if $first.product_list[0].carrier_list[0] eq 0} hide{/if}"> <input type="hidden" value="{$first.instance->id|intval}" name="id_carrier" /> {if isset($first.instance->delay[$cookie->id_lang])} <i class="icon-info-sign"></i> {strip} {$first.instance->delay[$cookie->id_lang]|escape:'htmlall':'UTF-8'} {if count($first.product_list) <= 1} ({l s='For this product:'} {else} ({l s='For these products:'} {/if} {/strip} {foreach $first.product_list as $product} {if $product@index == 4} <acronym title=" {/if} {strip} {if $product@index >= 4} {$product.name|escape:'htmlall':'UTF-8'} {if isset($product.attributes) && $product.attributes} {$product.attributes|escape:'htmlall':'UTF-8'} {/if} {if !$product@last} , {else} ">…</acronym>) {/if} {else} {$product.name|escape:'htmlall':'UTF-8'} {if isset($product.attributes) && $product.attributes} {$product.attributes|escape:'htmlall':'UTF-8'} {/if} {if !$product@last} , {else} ) {/if} {/if} {/strip} {/foreach} {/if} </td> <td rowspan="{$option.carrier_list|@count}" class="delivery_option_price"> <div class="delivery_option_price"> {if $option.total_price_with_tax && !$option.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))} {if $use_taxes == 1} {if $priceDisplay == 1} {convertPrice price=$option.total_price_without_tax}{if $display_tax_label} {l s='(tax excl.)'}{/if} {else} {convertPrice price=$option.total_price_with_tax}{if $display_tax_label} {l s='(tax incl.)'}{/if} {/if} {else} {convertPrice price=$option.total_price_without_tax} {/if} {else} {l s='Free'} {/if} </div> </td> </tr> {foreach $option.carrier_list as $carrier} {if $carrier@iteration != 1} <tr> <td class="delivery_option_logo{if $carrier.product_list[0].carrier_list[0] eq 0} hide{/if}"> {if $carrier.logo} <img class="order_carrier_logo" src="{$carrier.logo|escape:'htmlall':'UTF-8'}" alt="{$carrier.instance->name|escape:'htmlall':'UTF-8'}"/> {elseif !$option.unique_carrier} {$carrier.instance->name|escape:'htmlall':'UTF-8'} {/if} </td> <td class="{if $option.unique_carrier} first_item{/if}{if $carrier.product_list[0].carrier_list[0] eq 0} hide{/if}"> <input type="hidden" value="{$first.instance->id|intval}" name="id_carrier" /> {if isset($carrier.instance->delay[$cookie->id_lang])} <i class="icon-info-sign"></i> {strip} {$carrier.instance->delay[$cookie->id_lang]|escape:'htmlall':'UTF-8'} {if count($first.product_list) <= 1} ({l s='For this product:'} {else} ({l s='For these products:'} {/if} {/strip} {foreach $carrier.product_list as $product} {if $product@index == 4} <acronym title=" {/if} {strip} {if $product@index >= 4} {$product.name|escape:'htmlall':'UTF-8'} {if isset($product.attributes) && $product.attributes} {$product.attributes|escape:'htmlall':'UTF-8'} {/if} {if !$product@last} , {else} ">…</acronym>) {/if} {else} {$product.name|escape:'htmlall':'UTF-8'} {if isset($product.attributes) && $product.attributes} {$product.attributes|escape:'htmlall':'UTF-8'} {/if} {if !$product@last} , {else} ) {/if} {/if} {/strip} {/foreach} {/if} </td> </tr> {/if} {/foreach} </table> {/if} </div> </div> y Sustituir por esto: <div class="delivery_options_address"> {if isset($delivery_option_list)} {foreach $delivery_option_list as $id_address => $option_list} <p class="carrier_title"> NOTA PARA COMERCIALES: SELECCIONE SU CÓDIGO </p> <DIV class="delivery_options"> <SELECT name = "delivery_option[{$id_address}]" onchange="{if $opc}updateCarrierSelectionAndGift();{else}updateExtraCarrier('{$key}', {$id_address});{/if}" id="delivery_option_{$id_address}"> {foreach $option_list as $key => $option} <OPTION value="{$key}" {if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key}selected="selected"{/if}> {if $option.unique_carrier} {foreach $option.carrier_list as $carrier}{$carrier.instance->name} {/foreach} {if isset($carrier.instance->delay[$cookie->id_lang])}{$carrier.instance->delay[$cookie->id_lang]}{/if} {/if} {if count($option_list) > 1} {if $option.is_best_grade} {if $option.is_best_price}{l s='The best price and speed'} {else} {l s='The fastest'}{/if} {else} {if $option.is_best_price} {l s='The best price'} {/if} {/if} {/if} - {if $option.total_price_with_tax && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))} {if $use_taxes == 1} {convertPrice price=$option.total_price_with_tax} {l s='(tax incl.)'} {else} {convertPrice price=$option.total_price_without_tax} {l s='(tax excl.)'} {/if} {else} {l s='Free'} {/if} </OPTION> {/foreach} </SELECT> </DIV> A mi me ha funcionado. Si queréis cambiar el diseño, simplemente hacerlo desde el .css del theme. Un saludo Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now