Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pre-Alpha Testing Cross Selling Contribution


Guest

Recommended Posts

Download it here: http://www.aravia.com/cross_sale.tar.gz

 

I've heavily modified the code that Issac M sent to me this morning. Issac did a TON of work to make this project work, and deserves all of the credit for the project. If he doesn't mind I'll run the alpha testing phase and work on the TO-DO list. IF Issac wants to run this project, then I'll call it a day of good work and back off at this point.

 

I've made the following changes: much better SQL queries, integrated the stylesheets into the displays on the administration and catalog portions of the modifications, cleaned up a lot of the logic, and tightened up the formatting of the code. I did not add the check box logic yet, I wanted to get the basic functionality done, and get user feedback before I delve in any deeper.

 

You'll need to copy two new files to your OSC tree and slightly modify three files (mostly just a couple defines).

 

This is an PRE-ALPHA test. Post here your experiences with the modification, I will be packaging all suggestions that I implement into the software into a BETA software package on the OSC Contributions page, and then after a user period of a couple weeks to a month, I will apply any bug fixes and release a final 1.0 version.

 

WORDS OF WARNING: Please *do not* email me asking how to do this on Windows machines, I don't know, and I don't care. Please *do not* email me asking what to do with a tar file or how to add a table to MySQL, if you don't know, you shouldn't be using this software. Please *do* email me with helpful suggestions and advice concerning the software. Please *do* enjoy using the software!

 

Thanks!

 

PS: Don't forget to check out my awesome user tracking script that is also in pre-alpha. See it here: http://www.oscommerce.com/forums/viewtopic.php?t=23613

Link to comment
Share on other sites

Hi, I just downloaded it and while installing made some edits /nothing that changes functionality but makes it consistent with the structure of the current osc.

 

Add to catalog/admin/includes/boxes/catalog.php:

 

--- was ---

'<a href="' . tep_href_link(FILENAME_CROSS_SALE_PRODUCTS) . '" class="menuBoxContentLink">' . "Cross Sell Products" . '</a><br>' .

 

--- replace with ---

'<a href="' . tep_href_link(FILENAME_CROSS_SALE_PRODUCTS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CROSS_SALE_PRODUCTS . '</a><br>' .

 

in catalog/admin/includes/languages/english.php add somewhere after :"// categories box text in includes/boxes/catalog.php"

 

define('BOX_CROSS_SALE_PRODUCTS', 'Cross Sell Products');

 

in : catalog/modules/cross_sale.php find:

$info_box_contents[] = array('align' => 'left', 'text' => "We highly recommend you purchase these accompanied items!");

 

should be line 49

replace with :

$info_box_contents[] = array('align' => 'left', 'text' => TEXT_CROSS_SALE_PRODUCTS);

 

and in catalog/includes/languages/english/product_info.php add:

define('TEXT_CROSS_SALE_PRODUCTS', 'We highly recommend you purchase these accompanied items!');?> // replace with text you want

Link to comment
Share on other sites

BUG!

well not realty a bug but something that was missing for thouse of you who are using more than one language.

I'll email him and so he can update the tar.gz file.

so if you have some problems, and you are using more than one language, PLEASE HOLD...

Link to comment
Share on other sites

Keep the feedback coming. I'm eager to hear how people do with this so that I can get a beta release out this week.

 

In regards to the define stuff that I missed (as you stated above), I'll have full support for various languages and keep all languages strings in the proper OSC form for the beta release.

 

More feedback please!

 

Andrew

Link to comment
Share on other sites

For some reason i can not get this working at all.

 

It causes no bugs, the database is updatedm files are in etc...

 

I do not understand it. :huh:

 

I can configure it from Admin, but when I go to check on my site, it has made no difference at all.

I have removed the Also_purchased include out of products_info.php completely. So it does create the box even without that include, so something must be working.

 

It just seems to do the same as also purchased did, but deosnt change when I alter the setup in admin.

My snapshot is from March time.

 

What am I missing?

 

CC.

 

BTW - Everything on the admin side works spot on. :bigups:

Link to comment
Share on other sites

I've just installed it and got same as above, after having a 'dumb' look at the code, I figured that the 'related products' is displayed based on the 'cache', not 100% sure why etc, but I turned off my cache on adim, and it worked fine.

 

One thing I did notice though, is that if you've got a 'related' product already on an item, and no 'cross sell' product, it will just display the 'banner' and no contents, it seems this mod. is triggered the same time as 'related products' is, which is fine if customers have bought before, but if an item has not been sold before this mod. will never be triggered!!..

 

I'll attempt to have a look, but I'm sure there are people who can suss this in minutes to my hrs :(

 

Also I found to solve the header appearing with no products in it, change the cross_sale.php in the 'modules' dir like the following:

 

<snip>

 

if ($related_id_PR)

{

echo "<p>n";

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left', 'text' => "Also recommended");

new infoBoxHeading($info_box_contents,true,true);

 

$row = 0;

$col = 0;

$info_box_contents = array();

 

foreach ($related_id_PR as $related_id_query)

{

</snip>

 

In other words, move the 'header creation' bit into the 'id' check loop, not pretty by solves header being printed :)

 

ps. the new infoBoxHeading($info_box_contents,true,true); just makes both edges rounded :)

 

All in all a valuable mod, needs a bit more work to tidy, and to be honest, it sort of superceeds the related products part?..

 

 

John

Link to comment
Share on other sites

OK, that was easier than I thought, to get the cross sell to display whether or not a purchase has been made on that product, in the product_info.php in 'catlaog' dir. just move the include down one :) ... as per:

 

was:

 

<?php

   if ( (USE_CACHE == 'true') && !SID) {

    echo tep_cache_also_purchased(3600);

   } else {

    include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

    include(DIR_WS_MODULES . FILENAME_CROSS_SALE_PRODUCTS);

   }

 }

?>

 

now:

 

<?php

   if ( (USE_CACHE == 'true') && !SID) {

    echo tep_cache_also_purchased(3600);

   } else {

    include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

   }

    include(DIR_WS_MODULES . FILENAME_CROSS_SALE_PRODUCTS);

 }

?>

 

Hope this helps.

 

John

Link to comment
Share on other sites

How are you guys thinking of implementing this?

 

Are you planning to run both together? Or getting rid of also purchased?

 

I am not keene on the fact the 2 boxes appear, it is starting to get a little cluttered at the bottom of the page.

Plus they both appear to do pretty much the same thing, except we can control the cross sell box...

 

I am just thinking allowed really, but I would like feedback on your plans.

 

And Andrew - It seems to be working very well, thanks for a great mod.

 

CC.

Link to comment
Share on other sites

I am planing on removing the also purchased box since I dont have too many products and I dont need it. If you have more extensive inventory you might want to keep both of them.

 

As for my post above.. I was just trying to make it cleaner :) But :thumbsup: for the mod just what I needed.

Link to comment
Share on other sites

I'm in two minds really, as the 'also purchased' is a maintenance free module, but the cross sell is far more 'hassle' but has greater focus on products.

 

Places like amazon, have just one 'recommend' or 'upsell' , and like you say it can look at bit cluttered, and silly especially if someone has bought a related product which is in your 'upsell'......

 

I will prob. end up just using the upsell mod, as you can target your products much better. I reckon with a bit more 'forum' input this could turn out to be a must have mod.

 

Here's a few ideas:

 

Once you've selected you cross-sell items, it automatically takes you to the order screen and puts 1,2,3 etc in the order, not just 1 in all.

 

Then maybe once you've updated it, it takes you to the main screen and tells you DB updated.

 

These are only small suggestions, but it makes life easier..

 

Then maybe a tidier way of displaying everything, not sure how yet, but my products have long description, so it overflows a bit.

 

John

Link to comment
Share on other sites

I'm thinking of offering options to this, and users can also do their own modifications if they don't like the ways I'm thinking of.

 

1) ALLOW ALSO PURCHASED TO OVERRIDE CROSS SELLING

 

Cross selling will only appear if it's a product that doesn't have an also purchased box.

 

2) ALLOW BOTH TO APPEAR

 

Cross selling and also purchased will appear (in seperate boxes).

 

3) ONLY SHOW CROSS SELLING

 

Cross selling will be the only box to appear.

 

4) CUSTOM MODIFICATIONS:

 

I have a custom modification to my own script at:

 

http://www.discount-candle.com/catalog/pro...&products_id=50

 

I've actually modified my PRODUCT INFORMATION (product_info.php) page heavily so that I can add a box saying "Commonly Sold With" that shows the items.

 

NOTE ON THE CHECKBOXES:

 

Checkboxes to "add these products to my purchase" will only work on items without product attributes. This idea is on hold until I find an elegant way to deal with it.

Link to comment
Share on other sites

First of all, thanks for the contribution. I've been wanting something like this for a long time. I'm using an older snapshot but with a little tweaking and the changes spelled out by Guyver this contribution works great.

 

I do have a suggestion for the admin side. Would it be possible to create some sort of logic to implement a "bidirectional link option"? In order to save time you could check a box to include bidirectional links from each recommended product to another.

 

Just a suggestion.

 

Thanks again

 

H

Link to comment
Share on other sites

  • 1 month later...

After installing this software to late Sept. 2002 snapshot, I get the following error when clicking on the Cross Sell Products link on the Admin page:

 

Fatal error: Call to undefined function: tep_db_query() in /var/www/vhosts/MyStore.com/htdocs/admin/cross_sale.php on line 20

 

if I go to /admin/cross_sale.php lines 19-21 are thus:

 

 /* calling the function: list ($test_a, $test_b) = general_db_conct($query); */

 $result_1 = tep_db_query($query_1);

 $num_of_rows = mysql_num_rows($result_1);

 

Any help is greatly appreciated :thumbsup:

 

Best Regards, Ted

Link to comment
Share on other sites

  • 1 month later...

After installing the contribution it I go into the admin section, and then to 'cross_sale.php' and it displayed ALL my products, but three times.

 

A bug, or just me?

 

3times.jpg

Link to comment
Share on other sites

Using 3 languages? :shock:

 

Ya, actaully, but shouldent just display the product in the default language(english) once? I don't even want to use the other languages in my store anyways.....

 

 

*Side Note*

 

Linda, I got the product listing working! Since I was using Ians loaded3 snapshot it was using "product_listing_col.php." So I deleted it from the dir, and it gave me an error. So I renamed "product_listing.php" to "product_listing_col.php" and it works!!

Link to comment
Share on other sites

Ya, actaully, but shouldent just display the product in the default language(english) once? I don't even want to use the other languages in my store anyways.....

 

Only if distinct is in the select statement.

 

A lot of folks who write add-ons have one language and forget others have multiple lanugages and you need that distinct in there when grabbing from the products_description table or you get duplicates * the number of languages being used. :roll:

Link to comment
Share on other sites

What, me, only think about the english language? NEVER! I'm AMERICAN! We are globally conscious!

 

;)

 

Linda is right, you want to alter the code to only look for language_id=1 (or whatever your preferred language is)

 

Andrew

Link to comment
Share on other sites

You could write that to only select the current language of the Admin so that when you go in in english it's english ... etc.

 

You might have a friend come over that does not read english *cough* :shock:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...