X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding products to a static page (https://forum.x-cart.com/showthread.php?t=61046)

minfinger 09-28-2011 05:35 PM

Adding products to a static page
 
So here's the deal, my client has been pushing his Google AdWords pretty hard and a lot of the static pages are starting to populate the top 10 to 20 on a lot of the search terms that are bring people to the site.

He asks me the other day if we could put a specific set of items on each static page. For Example, since he sells dogs we have static pages setup for Yorkies, Dachshunds, etc. He wants to have the static page pop up and just show Yorkie's or whatever the topic of that page is. I guess it would be a product list displayed based on a search term.

Anyway, is this possible?

totaltec 09-29-2011 05:22 AM

Re: Adding products to a static page
 
Sure this could be accomplished easily. First you need to have "Parse Smarty tags in the content of embedded static pages" checked under General Settings.

Put the products you want to display in Featured Products for a certain category.

Then in your static page:
Code:

{include file="customer/main/products.tpl" products=$f_products}

Then in pages.php:
Code:

// Change X to your pageid # and Y to the id of the category you want to display for that page
if ($pageid == 'X')
{
    $cat = Y;
    include './featured_products.php';
}

After...
Code:

if ($page_data) {
        $filename = $pages_dir.$page_data["filename"];
        $page_content = func_file_get($filename, true);
        if ($page_content === false) {
            $page_content = func_get_langvar_by_name("lbl_page_not_found", array(), false, true);
        }

And before...
Code:

        $smarty->assign("page_data", $page_data);
        $smarty->assign("page_content", $page_content);

        $location[] = array($page_data["title"], "");


I got this code a long time ago, not certain that it applies to your version. But it should point you in the right direction at least. I believe the original code was posted by Jon, but I can't find the thread.

minfinger 04-20-2012 09:39 PM

Re: Adding products to a static page
 
I finally got around to trying this and I get this error on the one page I tried it on:

Error: Smarty error: [in evaluated template line 307]: syntax error: unrecognized tag: mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; (Smarty_Compiler.class.php, line 446) in /home/littlepu/public_html/include/lib/smarty/Smarty.class.php on line 1093

http://www.littlepuppiesonline.com/Yorkie-Poo-Puppies.html

totaltec 04-23-2012 07:34 AM

Re: Adding products to a static page
 
It looks like the problem is related to the pages html code. I see this stuff when users try and copy/paste from word documents into the WYSIWIG editor. Very frustrating.

What I would do, is start a new static page, one without a link showing. Then just add the code to display the products. Should be easier to test what the problem is, if we reduce the unknowns by having a clean page to start with. At least the error should change. Let me know.


All times are GMT -8. The time now is 08:59 PM.

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