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)
-   -   Product Grid Layout (https://forum.x-cart.com/showthread.php?t=69864)

ARW VISIONS 08-22-2014 02:56 PM

Product Grid Layout
 
http://www.2techchicks.com/xc514/

How do edit the product grid? used to be products_t.tpl.

I'd like to add our price before the price, and then the market price after the price.

ARW VISIONS 08-23-2014 09:16 AM

Re: Product Grid Layout
 
bump....

tony_sologubov 08-25-2014 06:26 AM

Re: Product Grid Layout
 
Sorry, did not quite get what you are trying to achieve? Once I understand what change you need to apply, I will be able to suggest how to do that.

Tony.

ARW VISIONS 08-25-2014 08:44 AM

Re: Product Grid Layout
 
I would like to add the words our price for before the price, then I would like to add the words market price and the market price.

like this:

Our Price: $9.99 market price: $19.99

totaltec 08-25-2014 09:11 AM

Re: Product Grid Layout
 
Tony, I think I got this one. :-)

I made a 15 minute tutorial walking you through exactly what to do to add the market price: http://youtu.be/LxpUCoYU_nU

You can see all my X-cart 5 tuts here: http://forum.x-cart.com/showthread.php?t=64668

totaltec 08-25-2014 09:33 AM

Re: Product Grid Layout
 
I just realized while reviewing my own tutorial, that my code does not take into account that the product may not have a market price.

I also want to detail the changes made thus far:
We enabled Market price module
We enabled Custom skin module.

Then we created skins/custom_skin/default/en/items_list/product/parts/common.product-price.tpl

with the following content:
Code:

{t(#Our Price#)}:
<widget class="\XLite\View\Price" product="{product}" displayOnlyPrice="true" />
{t(#Market price#)}: <span class="value">{formatPrice(product.getMarketPrice(),null,1)}</span>


If we change this code by wrapping an if statement around the market price:
Code:

{if:product.getMarketPrice()}
        {t(#Market price#)}: <span class="value">{formatPrice(product.getMarketPrice(),null,1)}</span>
{end:}

Then it will only display when the market price exists for the product.

ARW VISIONS 08-25-2014 10:03 AM

Re: Product Grid Layout
 
thank you

ARW VISIONS 08-25-2014 02:56 PM

Re: Product Grid Layout
 
Mike, thanks. the tutorial should point me in the right direction.

ARW VISIONS 08-27-2014 06:56 PM

Re: Product Grid Layout
 
ok a few issues.

contents of my file

Code:

{* vim: set ts=2 sw=2 sts=2 et: *}

{**
 * Item price
 *
 * @author    Qualiteam software Ltd <info@x-cart.com>
 * @copyright Copyright (c) 2011-2013 Qualiteam software Ltd <info@x-cart.com>. All rights reserved
 * @license  http://www.x-cart.com/license-agreement.html X-Cart 5 License Agreement
 * @link      http://www.x-cart.com/
 *
 * @ListChild (list="itemsList.product.grid.customer.info", weight="30")
 * @ListChild (list="itemsList.product.small_thumbnails.customer.details", weight="25")
 * @ListChild (list="itemsList.product.list.customer.info", weight="40")
 * @ListChild (list="itemsList.product.table.customer.columns", weight="40")
 * @ListChild (list="productBlock.info", weight="300")
 *}

{t(#Our Price#)}:
<widget class="\XLite\View\Price" product="{product}" displayOnlyPrice="true" />
{if:product.getMarketPrice()}
        {t(#Market price#)}: <span class="value">{formatPrice(product.getMarketPrice(),null,1)}</span>
{end:}


http://www.2techchicks.com/xc514/

stuff showing twice.
If I remove this
* @ListChild (list="itemsList.product.grid.customer.info", weight="30")

the issue goe away. Do i remove all the listchild calls?

Market price is not showing.
If I remove the if statement it shows but on all products.

our price and market price show in left list. Only want this in the grid portion in the middle.

thanks. ash

totaltec 08-27-2014 10:24 PM

Re: Product Grid Layout
 
Where is the file located? How is it being called? I believe it is essential for this solution of mine, that you being using your own custom skin or the custom skin module. And the path to the file is important too. My file is located at skins/custom_skin/default/en/items_list/product/parts/common.product-price.tpl what is yours?

If you are working with your own custom skin, perhaps it is not setup right. Or maybe the difference is because I am running 515 and I am guessing you are running 514 based on the directory name. But I doubt this is it. Test the solution in custom skin module on a 515 installation.

Are you using a "skin" module or are you using a module and decorating a class with it. How does the file get included? If it is in custom skin, then it should be overwriting the original skin file and not displaying twice. I don't know why if:product.getMarketPrice() statement is not working.


All times are GMT -8. The time now is 12:50 AM.

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