Thursday, November 29, 2012

Prestashop and GoodRelations plugin - solve problem with page

When you try to install goodrelations plugin in prestashop 1.4 or 1.5 you will see that your pages are broken. i mean your category page.

how can you fix broken by goodrelations plugin category page in prestashop?

open "prestashop installed folder on hosting/modules/goodrelations/goodrelations_page.tpl" file


Locate this part of code

 {if $shop_city}
  <div rel="vcard:adr">
   <div typeof="vcard:Address">
   {if $shop_country}
   <div property="vcard:country-name" content="{$shop_country|strip_tags|escape:'htmlall':'UTF-8'}"></div>
   {/if}
   {if $shop_city}
   <div property="vcard:locality" content="{$shop_city|strip_tags|escape:'htmlall':'UTF-8'}"></div>
   {/if}
   {if $shop_code}
   <div property="vcard:postal-code" content="{$shop_code|strip_tags|escape:'htmlall':'UTF-8'}"></div>
   {/if}
   {if $shop_address}
   <div property="vcard:street-address" content="{$shop_address|strip_tags|escape:'htmlall':'UTF-8'}"></div>
   {/if}
  </div>
  {/if}
  </div>


as you can see - open div is IN {if} statement, and closing div is OUTSIDE of ending {/if} statement, so when you have no shop_city configured, you will have spare div in your page code - this is the little bastard that ruin your design!
let's get rid of him

  {if $shop_city}
  <div rel="vcard:adr">
<div typeof="vcard:Address">
{if $shop_country}
   <br />
<div content="{$shop_country|strip_tags|escape:'htmlall':'UTF-8'}" property="vcard:country-name">
</div>
{/if}
   {if $shop_city}
   <br />
<div content="{$shop_city|strip_tags|escape:'htmlall':'UTF-8'}" property="vcard:locality">
</div>
{/if}
   {if $shop_code}
   <br />
<div content="{$shop_code|strip_tags|escape:'htmlall':'UTF-8'}" property="vcard:postal-code">
</div>
{/if}
   {if $shop_address}
   <br />
<div content="{$shop_address|strip_tags|escape:'htmlall':'UTF-8'}" property="vcard:street-address">
</div>
{/if}
  </div>
</div>
{/if}  
basically I've just put closing div into this shop_city {if} statement. so when you have no shop_city - no spare tags will appear on page.

No comments:

Post a Comment