X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Featured Products as a side menu (https://forum.x-cart.com/showthread.php?t=7748)

shan 05-25-2004 07:29 AM

Featured Products as a side menu
 
heres a simple one. works the same as featured products but just drops it in the side menu instead of in the center.

create a new file called menu_featured.tpl and store it in skin1 dir

Code:

{* $Id: menu_featured.tpl,v 1.8 2004/05/22 Shan Exp $ *}
{if $f_products ne ""}
{capture name=menu}
{section name=num loop=$f_products}


<table width="100%"  border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td align="center" valign="top">

{$f_products[num].product}

    </td>
  </tr>
  <tr>
    <td align="center" valign="top">

<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>
{include file="product_thumbnail.tpl" productid=$f_products[num].productid image_x=75 product=$f_products[num].product tmbn_url=$f_products[num].tmbn_url}
</a>

    </td>
  </tr>
  <tr>
    <td align="center" valign="top">

<font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$f_products[num].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$f_products[num].price}</font>

  </td>
 </tr>
</table>

<hr>

{/section}

{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Featured Items" menu_content=$smarty.capture.menu }

{/if}


now open up skin1/customer/home.tpl and insert this where you want the menu item to appear

Code:

{include file="menu_featured.tpl"}

Once youve done that you can remove the old featured products from the center areas.

Open skin1/customer/main/welcome.tpl and remove

Code:

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

Then open skin1/customer/subcategories.tpl and remove or comment out

Code:

{if $f_products ne ""}



{include file="customer/main/featured.tpl"}
{/if}


Works in 3.5.x but should work in other versions too

abeight 05-25-2004 08:42 AM

This is great, Shan. Here's a quick question though. What if you want to leave the featured products on the main page, and also have one additional product that shows in the menu box?

TonyD 05-25-2004 09:19 AM

is there a category.tpl that can replace the featured products?

camelia 11-10-2004 01:06 AM

Great mod, but how to make it pick 1 product at random?

mrbiggles 02-07-2005 05:44 AM

Hello I put this mod on my cart and was very impressed, then I clicked the image and got "access denied error ID:33"
I really wanted this mod so I did not give up. I noticed the description above the picture allowed me to link through to the detailed description of the product, so I took a gamble and replaced

<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>

with this

<a href=product.php?productid={$f_products[num].productid}}&cat={$cat}&page={$navigation_page}>


and it worked :lol: I am not experienced in this and this change is probably very basic but I can feel my head starting to expand already.

Im sure the saying "knows enough to be dangerous" comes to mind when some of you read this.

Hopefully there will not be any side effects from what I have done, because of my lack of knowledge I rely on a good backup and trial and error.
I have my ftp client ready, if I do something that stops the site running (about 8 times so far) I just upload the backup file.

I really like the drop down menus for manufacturers and categories but I cannot find anywhere where I can increase the visible number above 10 categories or manufacturers.
Regards Adam

mffowler 02-07-2005 01:40 PM

Increase the # of manufacturers in Gen. Settings/Module Options

- Mike

mrbiggles 02-07-2005 01:51 PM

Well that certainly stopped my head getting too big, thanks for that.
Regards Adam

garry 10-01-2005 05:39 AM

Great mod, does anyone know how to display the featured products on every page?
What I want to do is display the featured products that appear on the home page on all other pages not just the products that have been selected for the current category

groovico 10-01-2005 10:48 AM

Quote:

Originally Posted by garry
Great mod, does anyone know how to display the featured products on every page?
What I want to do is display the featured products that appear on the home page on all other pages not just the products that have been selected for the current category


You might be interested to know we have an add on that will be released very soon which will allow you to do this and alot more, if you're interested in being on the pre-release offer list please let me know.

slillig 02-13-2006 01:38 AM

Anyone find away to put this featured products menu on every page (global) throughout the entire site?

webtron 03-03-2006 07:58 PM

Does anybody got "Featured Products as a side menu" in all pages
implemented in 4.0.17?

It would appear similiar to the Best Sellers box, but instead,
it would be a Featured Products box.

Thanks.

webtron 03-15-2006 10:58 AM

bumping it

gaussboy 05-31-2006 05:59 PM

I just installed this mod and noticed that the side box is only showing up on the front page. This seems to be because that is the only place that $f_products is getting set. When I turn on debug mode, I can see that $f_products is populated on the front page and not populated everywhere else.

$f_products must be getting set somewhere in the php code. I looked in featured_products.php and didn't see any exclusions that would apply...

I guess I will look again :)

B00MER 05-31-2006 11:45 PM

Easiest way is to replicate xcart_featured edit featured_products.php and replicate the code needed again, and note:
Code:

$smarty->assign("f_products",$products);

$products can be reused, and f_products2 or such could be assigned.

You'll also want to duplicate the featured products code on the admin side changing the replicated xcart_featured table and making minor adjustments.

:arrow: www.modchipstore.com has multiple featured product ability on the front page to help them organize by console.

RichieRich 08-14-2006 11:03 AM

Is it possible to give a more comprehensive guide to doing this? I am a bit of a novice at this area. Also is it possible to make the other featured area look different? ie. with a different layout.

robr@trewaudio.com 08-31-2006 04:04 PM

Re: Featured Products as a side menu
 
Implemented the Featured Items "side menu" and it does work, however only on the front page. Has anyone found a way to apply this to all pages in addition to the home page?

carpeperdiem 08-31-2006 04:13 PM

Re: Featured Products as a side menu
 
Could the TopTenList mod accomplish what you want? It works great in 4.0.18 and 4.1.3 - don't know about other vsersions.

Freakmode 01-18-2008 01:39 AM

Re: Featured Products as a side menu
 
Bump

Did anyone find a way to get this on every page not just the home page?

MoonDog 01-21-2008 10:19 PM

Re: Featured Products as a side menu
 
Hi 01bodyjewellery,

Code:


Did anyone find a way to get this on every page not just the home page?

See if this will work.

This is for v4.1.9 but most likely will work for v4.1.8 also.

For some reason or other, when your in Admin and place featured items in a sub or sub-sub-category, the Featured Products will not display on your customer page. To prevent this problem:
Find these lines of code in your xcart/home.php file:
Code:

if (!empty($cat))
 include "./products.php";
 
if (empty($products))
 include "./featured_products.php";

and reverse them around so it looks like this:
Code:

if (empty($products))
 include "./featured_products.php";
 
if (!empty($cat))
 include "./products.php";


Make sure you populate your Featured Products with products in the Catagories section of the Admin side.

Now to display Featured Products when on the help pages:
open your xcart/help.php file and find these lines of code:
Code:


require "./auth.php";
require $xcart_dir."/include/categories.php";

underneath those lines of code add:
Code:


include "./featured_products.php";

To display Featured Products when on the checkout pages:
open your xcart/cart.php file and find these lines of code:
Code:


require "./auth.php";

and underneath that line place the following code:
Code:


include "./featured_products.php";

To diplay Featured Products when on the gift certificate page:
open your xcart/giftcert.php file and find this line of code:
Code:


require "./auth.php";

and underneath that line place the following code:
Code:


include "./featured_products.php";

To display Featured Products when on the manufacturers page:
open your xcart/modules/Manufacturers/customer_manufacturers_list.php file and find this line of code:
Code:

if ($active_modules["Manufacturers"])
    include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";


and underneath that line of code place the following code:
Code:


include "./featured_products.php";

To display Featured Product when on your static pages:
open your xcart/pages.php file and find these lines of code:
Code:


require "./auth.php";
require $xcart_dir."/include/categories.php";

and underneath those lines of code place the following code:
Code:


include "./featured_products.php";


- MoonDog -

Freakmode 01-23-2008 12:06 AM

Re: Featured Products as a side menu
 
Another great piece of help MoonDog - thanks works a treat in 4.1.8

toolexperts 06-11-2008 05:29 AM

Re: Featured Products as a side menu
 
how would you make this appear on the product pages?

toolexperts 06-11-2008 06:28 AM

Re: Featured Products as a side menu
 
i hope someone will answer as i have only until 5pm tomorrow to fix this or iam out of a job

toolexperts 06-11-2008 10:16 AM

Re: Featured Products as a side menu
 
I tried adding this into product.tpl to see if i could get it to populate on the product page, but nothing, kube, balinor, anyone have an idea?

{include file="menu_featured.tpl"}

Total Supply 06-03-2009 09:28 PM

Re: Featured Products as a side menu
 
Any ideas guys?
I have tried what has been suggested here but with no luck :(

I have the featured items scrolling on the home page in the right side bar. I need this to display on the products and product pages. it seems that the featured_products.php code uses the products.php code somehow as the scrollbar just cycles what ever products are on the page at the time not the featured products :(


All times are GMT -8. The time now is 03:30 PM.

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