Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding products to a static page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-28-2011, 05:35 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default 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?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #2  
Old 09-29-2011, 05:22 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
john99 (08-08-2012)
  #3  
Old 04-20-2012, 09:39 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default 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
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #4  
Old 04-23-2012, 07:34 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:32 AM.

   

 
X-Cart forums © 2001-2020