Jump to content
thirty bees forum

Show Barcode


AndyC

Recommended Posts

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

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

my panda example with variants from this topic

image.png.67767082dbc3965421f1d0a4c74df8ed.png

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 by colorful-ant
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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 by colorful-ant
Link to comment
Share on other sites

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       

1.JPG.489fc9a025d30af29f5f556f6fc21ddb.JPG

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>

 

 

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...