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)
-   -   Duplicate price with custom skin modification (https://forum.x-cart.com/showthread.php?t=70070)

RichieRich 09-24-2014 07:15 AM

Duplicate price with custom skin modification
 
I am attempting to hide the price, if the product is not available. This works as I upload the following file with this content;

"custom_skin/default/en/items_list/product/parts/common.product-price.tpl"

Code:

<widget
IF="product.isAvailable()"
class="\XLite\View\Price" product="{product}" displayOnlyPrice="true" />


I mentioned this worked, but this is until I perform a rebuild cache for some reason. After this time it will still hide the price for products not available, however it will display two prices in the thumbnails and product page. It could be some oversight I am missing. Please advise.

totaltec 09-24-2014 07:26 AM

Re: Duplicate price with custom skin modification
 
Richard,
Can you post the entire contents of your common.product-price.tpl file?

RichieRich 09-24-2014 07:48 AM

Re: Duplicate price with custom skin modification
 
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")
 *}

<widget
IF="product.isAvailable()"
class="\XLite\View\Price" product="{product}" displayOnlyPrice="true" />


totaltec 09-24-2014 07:55 AM

Re: Duplicate price with custom skin modification
 
Richard,
Try removing the @ListChild directives from the comments. Just remove the entire lines, all 5 of them. Then rebuild cache and see what you get. I think the original template is assigning itself to the lists, and then your modified template is reassigning it.

RichieRich 09-24-2014 08:43 AM

Re: Duplicate price with custom skin modification
 
That worked, thanks a lot Mike


All times are GMT -8. The time now is 02:45 AM.

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