Advertisement
Shoporama

Vis kun varianter med GTIN nummer

Feb 1st, 2021
1,838
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 1.53 KB | None | 0 0
  1. <form action="" method="post">
  2.     <input type="hidden" name="product_id" value="<{$product->getProductId()}>"/>
  3.     <input type="hidden" name="redirect" value="<{$product->getMetaValue('redirect')|escape}>"/>
  4.  
  5.     <{section name="j" loop=$attr}>
  6.         <{if $attr[j]->getIsVariant()}>
  7.             <div class="line">
  8.                 <label for="a<{$attr[j]->getAttributeId()}>"><strong><{$attr[j]->getName()|escape}>:</strong></label>
  9.                 <{if $attr[j]->getDataType() == "valuelist"}>
  10.                     <{assign var="values" value=$attr[j]->getValues()}>
  11.                     <select name="attributes[<{$attr[j]->getAttributeId()}>]" id="a<{$attr[j]->getAttributeId()}>" class="attribute">
  12.                         <{* <option value=""> - ingen -</option> *}>
  13.                        
  14.                         <{section name="k" loop=$values}>
  15.                             <{assign var="attribute_price" value=$product->getAttributePrice($values[k]->getAttributeValueId())}>
  16.                                 <{if $product->getGtin($values[k]->getAttributeValueId(),$attr[j]->getAttributeId())}>
  17.                                     <option value="<{$values[k]->getAttributeValueId()}>">
  18.                                         <{$values[k]->getVal()|escape}>
  19.                                         <{if $attribute_price}>
  20.                                             [<{$attribute_price|number_format:2:",":"."}> <{$webshop->getCurrency()}>]
  21.                                         <{/if}>
  22.  
  23.                                         (<{$product->getInStock($attr[j]->getAttributeId(), $values[k]->getAttributeValueId())}> på lager)
  24.  
  25.                                        
  26.                                     </option>
  27.                                 <{/if}>
  28.                         <{/section}>
  29.                     </select>
  30.                 <{/if}>
  31.             </div>
  32.         <{/if}>
  33.     <{/section}>
  34.     <input type="text" name="amount" value="1"/>
  35.     <input type="submit" value="Læg i kurven" class="add_to_basket"/>
  36. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement