AndyC Posted May 24, 2019 Posted May 24, 2019 Hi All Just about every product I have has a barcode which I want to show on my pages.. By searching google there doesn't seem to be a way to show this. But also though search I have found this code {if $product->ean13} {$product->ean13} {/if} Which works fine , the only thing is when it goes down to mobile devices it looses shape at the moment it looks like this Reference: WP 618YR Barcode : 5055685508810 But on mobiles looks like this Reference: WP 618YR Barcode : 5055685508810 Is there a way to float it left OR Is there a better way to show it on Thirty Bees thanks
colorful-ant Posted May 24, 2019 Posted May 24, 2019 (edited) it seems you have not properly in the format with p-tags, etc {if $product->ean13} <p>Barcode: {$product->ean13}</p> {/if} Edited May 24, 2019 by colorful-ant
AndyC Posted May 24, 2019 Author Posted May 24, 2019 Hi I thought the EAN post was about blogs , but tried it anyway and didn't work I edited my script but still the same , am trying to move it down 1 line and keep left . I've had my tabs sorted out now so my Panda theme is looking great which is why I have loads of space left on the right
colorful-ant Posted May 25, 2019 Posted May 25, 2019 (edited) my panda example with variants from this topic themes/panda/product.tpl <p id="product_reference" class="{if !$display_pro_reference} unvisible {/if} product_meta" {if empty($product->reference) || !$product->reference} style="display: none;"{/if}> <label class="product_meta_label">{l s='Reference:'} </label> <span class="editable"{if $enable_google_rich_snippets} itemprop="sku"{if !empty($product->reference) && $product->reference} content="{$product->reference}"{/if}{/if}>{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span> </p> <p id="product_ean13"{if empty($product->ean13) || !$product->ean13} style="display: none;"{/if}> <label>{l s='EAN: '} </label> <span {if !empty($product->ean13) && $product->ean13} content="{$product->ean13}"{/if}>{$product->ean13|escape:'html':'UTF-8'}</span> {if $enable_google_rich_snippets}<meta itemprop="gtin13" content="{$product->ean13|escape:'html':'UTF-8'}" />{/if} </p> Edited May 25, 2019 by colorful-ant
AndyC Posted May 25, 2019 Author Posted May 25, 2019 Thank you that worked , although had to edit yours as already have reference so started from <p id="product_ean13" I also see it doesn't show if there is no number ,which was also what I required and it seems to keep it's shape on mobile view now.. Am getting so close to going live now, it's scary So thank you again for your help
AndyC Posted June 4, 2019 Author Posted June 4, 2019 Hi Can I ask another question ..How can I get the EAN to sit below Reference as at the moment they are in 1 line thank you
colorful-ant Posted June 6, 2019 Posted June 6, 2019 (edited) im not sure - not testet now </p> <br> <p id="product_ean13"{if empty($product->ean13) || !$product->ean13} style="display: none;"{/if}> <label>{l s='EAN: '} </label> or try two => <br><br> dont forget clear shop cache and browser cache Edited June 6, 2019 by colorful-ant
colorful-ant Posted June 6, 2019 Posted June 6, 2019 if one <br> not helps but two you can try use <p>&nbpr;</p> or so
AndyC Posted June 9, 2019 Author Posted June 9, 2019 Hi Sorry for the late reply Tried as you suggested but ended up with it working but code is seen on the right .. Tried a few variations too this is the bit of code I want as in image above but without the &nbr; 🙂 Oh I put your code here in bold ..or is that the wrong place <p>&nbpr;</p> <p id="product_ean13"{if empty($product->ean13) || !$product->ean13} style="display: none;"{/if}> <label>{l s='EAN: '} </label> <span {if !empty($product->ean13) && $product->ean13} content="{$product->ean13}"{/if}>{$product->ean13|escape:'html':'UTF-8'}</span> {if $enable_google_rich_snippets}<meta itemprop="gtin13" content="{$product->ean13|escape:'html':'UTF-8'}" />{/if} </p>
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