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.

totaltec 08-28-2014 01:50 AM

Re: Product Grid Layout
 
Oh! I see the problem. My solution affects the column on the left column as well. I'm still learning myself, obviously. :-)

Let me look into the proper way to make this change without affecting the other elements...

ARW VISIONS 08-28-2014 10:15 AM

Re: Product Grid Layout
 
I set up a custom mod and skin

the path is -skins/nyfur/customer/en/items_list/product/parts/common.product-price.tpl

ARW VISIONS 08-28-2014 10:24 AM

Re: Product Grid Layout
 
had the same issue here with the double content.

http://forum.x-cart.com/showthread.php?t=69801&page=2

totaltec 08-28-2014 11:14 AM

Re: Product Grid Layout
 
Quote:

Originally Posted by ARW VISIONS
I set up a custom mod and skin

the path is -skins/nyfur/customer/en/items_list/product/parts/common.product-price.tpl

Shouldn't it be skins/nyfur/default/en ?
I'm just guessing, but if that is the path then it seems that it would not overwrite the template.

What paths does your Main.php have defined for the getSkins() function?

ARW VISIONS 08-28-2014 02:36 PM

Re: Product Grid Layout
 
I followed these instructions to the best of my ability.

http://kb.x-cart.com/display/XDD/How+to+create+a+skin

totaltec 08-28-2014 04:30 PM

Re: Product Grid Layout
 
Maybe we have the blind helping the blind here. I just tried adding the Our Price statement with this code:
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="25")
 *}

{t(#Our Price#)}:

I am using Custom Skin module, and I created this template in skins\default\en\modules\XC\CustomSkin\items_list\ product\grid.product.our-price.tpl

It showed up just where I expected it to, because of @ListChild (list="itemsList.product.grid.customer.info", weight="25")

Then I created skins\default\en\modules\XC\CustomSkin\items_list\ product\grid.product.market-price.tpl

with this code:
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="35")
 *}

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


totaltec 08-28-2014 04:55 PM

Re: Product Grid Layout
 
Not sure if I should have had to put those skins in the skins/default/en folder like I did or in skins/custom_skin/default/en. It works fine in the former: https://docs.google.com/file/d/0B46HNJGXAQ6gb2MxTWJrSlNWUlU/

Puts the Our Price label and the Market Price just in the grid, and nowhere else.

I experimented by creating the same two templates in the custom skin directory:
skins\custom_skin\default\en\items_list\product\gr id.product.market-price.tpl
and:
skins\custom_skin\default\en\items_list\product\gr id.product.our-price.tpl
And nothing happened. I think the custom skin can only overwrite templates, not create new ones.

Since the templates are created in the default/en category, I can now override them in the custom_skin directory with this path:
skins\custom_skin\default\en\modules\XC\CustomSkin \items_list\product\grid.product.market-price.tpl
and:
skins\custom_skin\default\en\modules\XC\CustomSkin \items_list\product\grid.product.our-price.tpl

totaltec 08-28-2014 05:43 PM

Re: Product Grid Layout
 
1 Attachment(s)
Sorry to keep posting, but I keep learning and encountering different behavior!

I've just installed a fresh copy of XC5 on a hosted account with TSS, previously I was working on my local Windows machine. Everything is working differently than before! I packed up the custom skin module and uploaded it to the hosted site. Then I enabled the Market Price module, and setup the market price on the Macbook. Completely different results! https://docs.google.com/file/d/0B46HNJGXAQ6gb3RlQXpzRlZsSjA/

So I am starting to understand your duplicate content. Its just not happening at all for me on my local machine.

Okay so now I have removed the skins/default/en/modules/XC/CustomSkin folder, and it got rid of one of my duplicates.

Then I removed skins/custom_skin/default/en/modules and that got rid of another.

Now I just have two files:
skins/custom_skin/default/en/items_list/product/grid.product.market-price.tpl
skins/custom_skin/default/en/items_list/product/grid.product.our-price.tpl

With the same content as above. Everything is working perfectly. I'm going to test overwriting a file with the custom skin on this hosted box. It went perfectly, I created skins/custom_skin/default/en/items_list/product/parts/common.product-price.tpl and added the text Hello World. It worked perfectly, overriding the default template. You can see it all working for the time being here: http://xcartnext.com/

I've attached my copy of the Custom skin module to this post. I renamed it to zip from tar, just so I could upload it. rename it .tar when you download it.

ARW VISIONS 08-28-2014 06:06 PM

Re: Product Grid Layout
 
I only get the duplicate content when I re-deploy the store :/

totaltec 08-28-2014 06:12 PM

Re: Product Grid Layout
 
Quote:

Originally Posted by ARW VISIONS
I only get the duplicate content when I re-deploy the store :/

Can you pack your module and attach it or send it to me?

ARW VISIONS 08-28-2014 06:15 PM

Re: Product Grid Layout
 
Right after that cheeseburger and beer. I'm done for a few minutes. ](*,)

tony_sologubov 09-03-2014 02:38 AM

Re: Product Grid Layout
 
Quote:

Originally Posted by ARW VISIONS
I only get the duplicate content when I re-deploy the store :/


You should not use @ListChild directives in your skin as long as you overwrite existing templates. If you create new templates, then of course you should put @ListChild directives in order to put tempaltes into right view lists.

So, the solution here is to remove these lines:
* @ListChild (list="itemsList.product.grid.customer.info", weight="30")
* @ListChild (list="itemsList.product.list.customer.info", weight="40")
* @ListChild (list="itemsList.product.table.customer.columns", weight="40")

Please, let me know if it helps.


All times are GMT -8. The time now is 06:55 PM.

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