Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 General
 Suggestions - NOT QUESTIONS
 $parameter to automate Related Products feature
Author « Topic »  

ITZAP
Ecommerce Template Guru

Australia
1009 Posts

Posted - 10/11/2021 :  19:03:19  
I would like to suggest that a $parameter be added like:

$relatedprevnext=TRUE;

This would give the Webmaster an option to automate the Related Products feature so that the 2 pages shown as "Related" are the same as PREVIOUS and NEXT.

However, if other products/pages are manually chosen as "Related", then those would take precedence.

On websites with many, many products/pages, it is quite laborious to manually choose Related Products/Pages. So, where there are none chosen, displaying the PREVIOUS and NEXT pages would be better than nothing.

Gary

dbdave
ECT Moderator

USA
10276 Posts

Posted - 10/11/2021 :  19:25:33  
That's a great idea.
Automated related products.
Perhaps there could be several settings, such as the prev-next, but also a random selection from the same category, with a setting on how many to show.

David

Steved
Ecommerce Template Guru

United Kingdom
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 10/12/2021 :  00:02:56  
Having gone through this process of manually relating all my products, I agree this would be a very useful feature!

John M
Advanced Member

457 Posts

Posted - 10/12/2021 :  07:53:25  
Here is how we have auto related items for a few years now by adding a group related function added to the inccrosssell.php

Add this to your includes file:
$csgrouprelatedtitle="For example Your Title for auto related items";

Add the group related option to the includes or individually on the productdetails.php, cart.php, etc... as required.
$crosssellaction="grouprelated,related";

Adjust how you want the grouping to work $productlist=substr($prodlist,1,6); This matches every product ID from the 1st to 6th characters.

In inccrosssell.php just below the related function around line 163:



elseif($crosssellaction=='grouprelated'){ // Products recommended with this product (Would need v5.1)
if(@$csgrouprelatedtitle=='') $crossselltitle='Alternative choices with items in your cart.'; else $crossselltitle=$csgrouprelatedtitle;
if($prodlist==''){
$addcomma='';
$sSQL = "SELECT cartProdID FROM cart WHERE cartCompleted=0 AND cartSessionID='" . escape_string($thesessionid) . "'";
$result=ect_query($sSQL) or ect_error();
while($rs=ect_fetch_assoc($result)){
$prodlist.=$addcomma . "'" . escape_string($rs['cartProdID']) . "'";
$addcomma=',';
}
ect_free_result($result);
}
if($prodlist!=''){
$productlist=substr($prodlist,1,6);
$sSQL = 'SELECT pID FROM products WHERE pID Like "' . $productlist . '%"';
$addcomma=''; $relatedlist='';
$result=ect_query($sSQL) or ect_error();
while($rs=ect_fetch_assoc($result)){
$relatedlist.=$addcomma . "'" . escape_string($rs['pID']) . "'";
$addcomma=',';
}
ect_free_result($result);
}


You can also optionally add this to the includes file $productlist=substr($prodlist,1,6); to make it easier to tweak to match your own requirements and scheme for product ID's.

As an example in our product ID's we use 5 numbers at the start which are always unique followed by 2 to 5 letters for related items.
e.g. A product ID with 65486RSCA will be auto related to all items with product ID beginning with 65486R. You can tweak to however you want but you do need to first standardise your product ID's so this will work.

John

Edited by - John M on 10/12/2021 09:55:08
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000