Jump to content

Kupon kódok legördülő listában


szabolcs77

Recommended Posts

Sziasztok!

 

felmerült egy olyan igény, hogy ha a felhasználónak van kuponja amit fel tud használni, akkor a vásárlási összesítőnél beírásos megoldás helyett egy legördülő listába jelenjen meg a felhasználható kupon(ok).

 

Milyen megoldás van erre?

Link to comment
Share on other sites

  • 6 months later...

Nekem is felmerült ez a kívánság, én a következő képen oldottam meg:

 

shopping-cart.tpl -be ez került

   <select class="discount_name" id="discount_name" name="discount_name">
{foreach from=$cart_rules item=discountDetail name=myLoop}
     <option value="{$discountDetail.code}">{$discountDetail.code} - {$discountDetail.name}


{if $discountDetail.id_discount_type == 1}
{$discountDetail.value|escape:'htmlall':'UTF-8'}%
{elseif $discountDetail.id_discount_type == 2}
{convertPrice price=$discountDetail.value} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
{elseif $discountDetail.id_discount_type == 3}
{l s='Free shipping'}
{else}
-
{/if}
</option>
{/foreach}
   </select>

valamint a meghívó control-ert (OrderController.php) is ki kellett bővítenem ezzel:

$cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false);
$nb_cart_rules = count($cart_rules);

$this->context->smarty->assign(array('nb_cart_rules' => (int)$nb_cart_rules, 'cart_rules' => $cart_rules, 'discount' => $cart_rules, 'nbDiscounts' => (int)$nb_cart_rules));	

FIGYELEM!! PRÓBÁLGATÁS ELŐTT NE FELEJTS EL MÁSOLATOT KÉSZÍTENI!!!

 

és itt a 2db módosított file is:

kopun_lenyilo.zip

  • Like 1
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...