X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   QuickViews Problem (https://forum.x-cart.com/showthread.php?t=72691)

GlasPak 08-31-2015 11:41 AM

QuickViews Problem
 
I am not sure why but our "quickviews" for the products are just displaying a URL for "more details" that takes you to the actual page. I need to put in here some text (Pieces per Case) so that it shows up in quickviews.

http://glaspak.com/bormioli-fido-jars
For example the Fido 200 ml Terrine Hermetic Jar.

Edit:
I am trying to modify quicklook to add a new class


<li class="ppc-field">
<span class="name">{t(#Pieces Per Case#)}</span>
<span class="ppc-field-value">{item.product.getPPCField()}</span>
</li>

But I can't figure out where any reference to quicklook are (all Quicklook gives is a link that says "More details")

qualiteam 09-01-2015 05:25 AM

Re: QuickViews Problem
 
Quickviews don't show product descriptions in X-Cart 5 out of the box. The popup block is too small for the description to fit in there.

However, with a small custom module you can make the description appear in Quicklooks too. To do this you should add the skins/default/en/product/details/parts/common.product-title.tpl template into the "product.details.quicklook.info" list with the height parameter set to 18 (out of the box the template goes into the "product.details.page.info" list only).

GlasPak 09-01-2015 05:36 AM

Re: QuickViews Problem
 
I followed this http://kb.x-cart.com/display/XDD/Adding+new+property+to+a+product to create a new field in which I have item.ppc-field.tpl for the invoice

Can I just add that instead?

Edit: I edited my item.ppc-field.tpl

Quote:

{* vim: set ts=2 sw=2 sts=2 et: *}
{**
* @ListChild (list="invoice.item.name", weight="20")
* @ListChild (list="product.details.quicklook.info", weight="20")
*}
<li class="ppc-field">
<span class="name">{t(#Pieces Per Case#)}</span>
<span class="ppc-field-value">{item.product.getPPCField()}</span>
</li>

And all it did was break quicklook.

qualiteam 09-01-2015 07:51 AM

Re: QuickViews Problem
 
It should be just "{product.getPPCField()}" for the "product.details.quicklook.info" list, not "{item.product.getPPCField()}".

GlasPak 09-01-2015 09:06 AM

Re: QuickViews Problem
 
Quote:

Originally Posted by qualiteam
It should be just "{product.getPPCField()}" for the "product.details.quicklook.info" list, not "{item.product.getPPCField()}".


What if the value is null?

Got it to work but any attempt at trying to have it ignored if the value of product.getPPCField() is zero length failed miserably!

qualiteam 09-02-2015 12:43 AM

Re: QuickViews Problem
 
Try this one:
PHP Code:

...
<
li class="ppc-field" IF="product.getPPCField()">
  <
span class="name">{t(#Pieces Per Case#)}</span>
  
<span class="ppc-field-value">{product.getPPCField()}</span>
</
li>                      
... 


GlasPak 09-02-2015 06:47 AM

Re: QuickViews Problem
 
Quote:

Originally Posted by qualiteam
Try this one:
PHP Code:

...
<
li class="ppc-field" IF="product.getPPCField()">
  <
span class="name">{t(#Pieces Per Case#)}</span>
  
<span class="ppc-field-value">{product.getPPCField()}</span>
</
li>                      
... 



Trying to understand this before I implement... What does IF="product.getPPCField()" do? I can't find documentation on it.

Also I am guessing I can change li to div (don't want it in a list).

qualiteam 09-02-2015 07:06 AM

Re: QuickViews Problem
 
This means the tag should be displayed only if the function returns TRUE or a data that PHP would cast into TRUE. NULL turns into FALSE, so the LI tag won't be rendered for products with getPPCField() being NULL.

GlasPak 09-02-2015 07:19 AM

Re: QuickViews Problem
 
Quote:

Originally Posted by qualiteam
This means the tag should be displayed only if the function returns TRUE or a data that PHP would cast into TRUE. NULL turns into FALSE, so the LI tag won't be rendered for products with getPPCField() being NULL.


It didn't work... Is it possible it is a 0 length instead of null? Is there a way for it to assume null and zero length = False?

This is what I used

PHP Code:

<div class="ppc-field" IF="product.getPPCField()">
      <
b>
      <
span class="name">{t(#Pieces Per Case: #)}</span>
      
<span class="ppc-field-value">{product.getPPCField()}</span>
      </
b>
  <
div


qualiteam 09-02-2015 08:07 AM

Re: QuickViews Problem
 
What is in product.getPPCField() when it doesn't work?


All times are GMT -8. The time now is 07:54 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.