Forums / Addon Admin Tools / Cross Sell Advanced [Support Thread]

Cross Sell Advanced [Support Thread]

Results 1 to 20 of 169
26 Jan 2014, 21:40
#1
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Cross Sell Advanced [Support Thread]

Establishing a formal support thread for Cross Sell Advanced as there has never been one.

Based on the original Cross Sell module! It is easy to use, has a graphical interface to quickly find products to cross sell and is very light weight. 6 cross sell products can set specifically set for each of your Zen Cart product pages.

Cross Sell Advanced expands the original Cross Sell for even more ease of use by allowing you to setup 6 cross sells using the product model numbers.

Download it here: http://www.zen-cart.com/downloads.php?do=file&id=400
01 Mar 2014, 19:57
#2
savatom avatar

savatom

New Zenner

Join Date:
Nov 2013
Posts:
33
Plugin Contributions:
0

Re: Cross Sell Advanced [Support Thread]

So is this an UPGRADE to the previous version of your cross sell or can it be a STAND ALONE install? I dont see a products_xsell.sql file with the 1.3 download. Thank you.
01 Mar 2014, 20:14
#3
savatom avatar

savatom

New Zenner

Join Date:
Nov 2013
Posts:
33
Plugin Contributions:
0

Re: Cross Sell Advanced [Support Thread]

Nevermind, i just noticed the requirements.....this is an upgrade

"REQUIREMENTS: It REQUIRES cross sell to be installed."
01 Mar 2014, 20:27
#4
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

SavaTom:

Nevermind, i just noticed the requirements.....this is an upgrade

"REQUIREMENTS: It REQUIRES cross sell to be installed."


No it doesn't.. This is an UPGRADE of the original Cross Sell module.. The description is incorrect.. it SHOULD read:

Based on the original Cross Sell module! It is easy to use, has a graphical interface to quickly find products to cross sell and is very light weight. 6 cross sell products can set specifically set for each of your Zen Cart product pages.


Advanced Cross Sell expands the original Cross Sell for even more ease of use by allowing you to setup 6 cross sells using the product model numbers.
07 Apr 2014, 14:45
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

SavaTom:

Nevermind, i just noticed the requirements.....this is an upgrade

"REQUIREMENTS: It REQUIRES cross sell to be installed."


Module description has been updated to reflect the current codebase:

A new and improved version of the original Cross Sell module!

What is Cross Selling??
=================
Cross selling is a suggestive selling method where the shopowner offers customers the opportunity to purchase items related to the product they are viewing.

Out the box, Zen Cart includes a "Customers who bought this product also purchased.." centerbox so that whenever a customer purchases an item, it looks and finds other customers who also purchased the same item and selects other products they purchased.

But what if the shopowner wanted to select specific related items to offer their customers? Advanced Cross Sell adds this exact kind of functionality.

Advanced Cross Sell has a graphical interface to quickly find products for cross selling. Set up to six (6) optional products per product for each Zen Cart product page. Additionally this module has an advanced cross sell user interface which allows the shopowner/administrator to setup all six (6) cross sells on the same screen using products numbers.

How Does Advanced Cross Sell Work??
=============================
The shop sells Walkmans.. If the shopowner/administrator adds cross sell products to the Walkman product via the Advanced Cross Sell interfaces, the product page will now includes a new centerbox.. "may we also recommend batteries, case cd's etc."


You ONLY need to install this module..
09 Apr 2014, 17:58
#6
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Posts:
1,562
Plugin Contributions:
47

Re: Cross Sell Advanced [Support Thread]

If you were previously using a different version of this plugin, the auto installer doesn't remove the old database entries. The logic could be improved so that duplicate DB entry errors are not a problem.
10 Apr 2014, 14:26
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Maybe I am not reading the code right in the file:
YOUR_ADMIN\includes\init_includes\init_xsell_config.php

but if there wasn't an old version or a previous version to clean up, wouldn't this end up deleting the configuration_keys for:
PRODUCTS_OPTIONS_TYPE_SELECT
UPLOAD_PREFIX
TEXT_PREFIX

I have not tried to install this, but I was peeking at the code and it made me start to wonder about doom and gloom ... :lookaroun
11 Apr 2014, 02:36
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

numinix:

If you were previously using a different version of this plugin, the auto installer doesn't remove the old database entries. The logic could be improved so that duplicate DB entry errors are not a problem.

If you are seeing this then perhaps you are right.. I'm not seeing the problem for no other reason except that I'm not really a true code monkey.. so perhaps a HINT on what the issue is would be most appreciated.. :smile:

Ajeh:

Maybe I am not reading the code right in the file:
YOUR_ADMIN\includes\init_includes\init_xsell_config.php

but if there wasn't an old version or a previous version to clean up, wouldn't this end up deleting the configuration_keys for:
PRODUCTS_OPTIONS_TYPE_SELECT
UPLOAD_PREFIX
TEXT_PREFIX

I have not tried to install this, but I was peeking at the code and it made me start to wonder about doom and gloom ... :lookaroun

I'm not sure how this would happen since the delete statements target ONLY the Cross Sell configuration entries and groups.. But again, I'm not seeing the problem for no other reason except that I'm not really a true code monkey.. a hint as to where the issue lies would be appreciated.. :smile:
11 Apr 2014, 02:57
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

In that file, you check for the configuration_group_id in the configuration_group table then Delete for that value in the configuration table ...

        /* Find configuation group ID of Previous Version of Cross Sell */
        $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
        $result = $db->Execute($sql);
        $xsell_old_configuration_id = $result->fields['configuration_group_id'];

        /* Remove Previous Version of Cross Sell from the configuration group table */
        $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
        $db->Execute($sql);

        /* Remove Previous Version of Cross Sell items from the configuration table */
        $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
        $db->Execute($sql);


But if nothing is found on the configuration_group, the value is probably going to be 0 for $xsell_old_configuration_id so you first delete from the configuration_group table where the configuration_group_id is 0 which should probably not cause any harm but is not a good idea ...

The problem is you then delete in the configuration table for that configuration_group_id and the 0 is the configuration_group_id for these 3 values in the configuration table ...

So, rather than deleting for what you mean to delete for, you delete important configuration_keys for Zen Cart ...

This thread better explains the issue:
http://www.zen-cart.com/showthread.php?170483-Attribute-Required-for-Text-flag-not-working

and post #9 is a nice write up by swguy explaining the specifics of the issue with a possible better approach to this ...
11 Apr 2014, 02:58
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

NOTE: you really need to read through that file to find any other similar issues ...
11 Apr 2014, 08:15
#11
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Ajeh:

NOTE: you really need to read through that file to find any other similar issues ...

Well if I run the query
SELECT configuration_group_id FROM zen_configuration_group WHERE configuration_group_title = 'Deluxe Cross Sell' LIMIT 1;


I get zero results. So wouldn't the delete statement be deleting nothing and NOT the 0 configuration group???
11 Apr 2014, 11:00
#12
grantopt avatar

grantopt

New Zenner

Join Date:
May 2012
Posts:
36
Plugin Contributions:
0

Re: Cross Sell Advanced [Support Thread]

DivaVocals:

Well if I run the query
SELECT configuration_group_id FROM zen_configuration_group WHERE configuration_group_title = 'Deluxe Cross Sell' LIMIT 1;


I get zero results. So wouldn't the delete statement be deleting nothing and NOT the 0 configuration group???


I see that this is the same thing going on when I asked in the Testimonials manager about those inserts in the uninstall sql. And Ajeh responded that those are 3 stock configs for ZC. After research under certain circumstances it can remove the 3 stock configs. So the 3 inserts plus another for IH was there as a safety when the sql deletes the id for 0.

After reading, there has to be a "and xxx != 0" as a fallback in case the mod id equates to 0.
11 Apr 2014, 13:47
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

I would suggest posting your full proposed fix, before contributing it so that it can be checked ...
11 Apr 2014, 20:16
#14
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Not the SAME thing at all.. The Testimonials Manager SQL is just plain old WRONG because it inadvertently sets a configuration group id variable to configuration group '0'. (read my response in that thread -- I DO state the issue and solution)

The SQL in question for this module DOES NOT do this..

grantopt:

I see that this is the same thing going on when I asked in the Testimonials manager about those inserts in the uninstall sql. And Ajeh responded that those are 3 stock configs for ZC. After research under certain circumstances it can remove the 3 stock configs. So the 3 inserts plus another for IH was there as a safety when the sql deletes the id for 0.

After reading, there has to be a "and xxx != 0" as a fallback in case the mod id equates to 0.


No fall back required.. simply DO NOT set a variable for configuration group id '0'.. Just don't write SQL scripts which delete ANYTHING from configuration_group '0'
11 Apr 2014, 20:18
#15
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Ajeh:

I would suggest posting your full proposed fix, before contributing it so that it can be checked ...

Are you responding to my previous post.. because HONESTLY I am still not seeing the issue with the SQL.. If I query for a configuration group that does not exist, I can't possibly delete anything from it let alone configuration group ID '0'.. I WANT to fix it if it's broken, but I'm REALLY not understanding why it's wrong..

**confused**
11 Apr 2014, 20:47
#16
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Posts:
13,980
Plugin Contributions:
46

Re: Cross Sell Advanced [Support Thread]

As I tiptoe :lookarouninto the discussion, I'd like to propose the following changes to the code fragment that Ajeh posted in post #9. The issue, as I see it, is that if the 'old title' didn't exist, the $result object wouldn't have any fields and, with mySQL's conversion in effect the value '$xsell_old_configuration_id' would be magically converted to (you guessed it) 0.
/* Find configuation group ID of Previous Version of Cross Sell */
        $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
        $result = $db->Execute($sql);
        $xsell_old_configuration_id = $result->fields['configuration_group_id'];

        /* Remove Previous Version of Cross Sell from the configuration group table */
        $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
        $db->Execute($sql);

        /* Remove Previous Version of Cross Sell items from the configuration table */
        $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
        $db->Execute($sql);

I'd suggest a small recoding of the fragment as follows:
/* Find configuation group ID of Previous Version of Cross Sell */
        $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
        $result = $db->Execute($sql);
        // -----
        // Only remove the old configuration if it exists!
        //
        if (!$result->EOF) {
          $xsell_old_configuration_id = $result->fields['configuration_group_id'];

           /* Remove Previous Version of Cross Sell from the configuration group table */
          $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
          $db->Execute($sql);

          /* Remove Previous Version of Cross Sell items from the configuration table */
          $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
          $db->Execute($sql);
        }
11 Apr 2014, 22:02
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

As a test, temporarily create the file:
/your_secret_admin/test_delete.php

with the code:
<?php
require('includes/application_top.php');


    $xsell_old_menu_title = 'Cross Sell';
    $xsell_menu_title = 'Cross Sell Advanced';
    $xsell_menu_text = 'Cross Sell Advanced Configuration';

echo 'Previous Version of Cross Sell: ' . '<br><br>';
      /* Find configuation group ID of Previous Version of Cross Sell */
      $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
      $result = $db->Execute($sql);
        $xsell_old_configuration_id = $result->fields['configuration_group_id'];
echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';

      /* Remove Previous Version of Cross Sell from the configuration group table */
      $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
//        $db->Execute($sql);
echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';


// test results with SELECT
echo '==================================' . '<br><br>';
      $sql = "SELECT * FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
      $chk_sql =  $db->Execute($sql);
echo 'TEST XSELL CODE what SELECT finds in TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
echo '<strong>RecordCount found TABLE_CONFIGURATION_GROUP: ' . $chk_sql->RecordCount() . '</strong><br>';

// if found what would be deleted
while (!$chk_sql->EOF) {
  echo 'configuration_group_id: ' . $chk_sql->fields['configuration_group_id'] . '<br><br>';
  $chk_sql->MoveNext();
}

// test results with SELECT
      /* Remove Previous Version of Cross Sell items from the configuration table */
      $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
echo '==================================' . '<br><br>';
echo 'TEST XSELL CODE what would be deleted TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';
echo 'XSELL CODE what DELETE would be run on TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
//        $db->Execute($sql);
      $sql = "SELECT * FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
      $chk_sql =  $db->Execute($sql);

echo 'XSELL CODE what SELECT finds in TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
echo '<strong>RecordCount found TABLE_CONFIGURATION: ' . $chk_sql->RecordCount() . '</strong><br><br>';

echo 'What would be removed: ' . '<br>';
// if found what would be deleted
while (!$chk_sql->EOF) {
  echo 'configuration_key: ' . $chk_sql->fields['configuration_key'] . '<br>';
  $chk_sql->MoveNext();
}
echo '==================================' . '<br><br>';


While kind of a scrappy file, it would show you the results of what gets deleted if there isn't a value for: $xsell_old_configuration_id

and what would end up deleted from the configuration table ...

This will not delete anything as it uses SELECTS rather than actual DELETE on the tables but does show you the content of the $sql and what keys would get wiped out ...

Lat9's fix would add a safety on this portion of the code, and it needs to be done similarly on anything else doing DELETE in this file ...
12 Apr 2014, 00:23
#18
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Ajeh:

As a test, temporarily create the file:
/your_secret_admin/test_delete.php

with the code:
<?php
require('includes/application_top.php');


    $xsell_old_menu_title = 'Cross Sell';
    $xsell_menu_title = 'Cross Sell Advanced';
    $xsell_menu_text = 'Cross Sell Advanced Configuration';

echo 'Previous Version of Cross Sell: ' . '<br><br>';
      /* Find configuation group ID of Previous Version of Cross Sell */
      $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
      $result = $db->Execute($sql);
        $xsell_old_configuration_id = $result->fields['configuration_group_id'];
echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';

      /* Remove Previous Version of Cross Sell from the configuration group table */
      $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
//        $db->Execute($sql);
echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';


// test results with SELECT
echo '==================================' . '<br><br>';
      $sql = "SELECT * FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
      $chk_sql =  $db->Execute($sql);
echo 'TEST XSELL CODE what SELECT finds in TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
echo '<strong>RecordCount found TABLE_CONFIGURATION_GROUP: ' . $chk_sql->RecordCount() . '</strong><br>';

// if found what would be deleted
while (!$chk_sql->EOF) {
  echo 'configuration_group_id: ' . $chk_sql->fields['configuration_group_id'] . '<br><br>';
  $chk_sql->MoveNext();
}

// test results with SELECT
      /* Remove Previous Version of Cross Sell items from the configuration table */
      $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
echo '==================================' . '<br><br>';
echo 'TEST XSELL CODE what would be deleted TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';
echo 'XSELL CODE what DELETE would be run on TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
//        $db->Execute($sql);
      $sql = "SELECT * FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
      $chk_sql =  $db->Execute($sql);

echo 'XSELL CODE what SELECT finds in TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
echo '<strong>RecordCount found TABLE_CONFIGURATION: ' . $chk_sql->RecordCount() . '</strong><br><br>';

echo 'What would be removed: ' . '<br>';
// if found what would be deleted
while (!$chk_sql->EOF) {
  echo 'configuration_key: ' . $chk_sql->fields['configuration_key'] . '<br>';
  $chk_sql->MoveNext();
}
echo '==================================' . '<br><br>';


While kind of a scrappy file, it would show you the results of what gets deleted if there isn't a value for: $xsell_old_configuration_id

and what would end up deleted from the configuration table ...

This will not delete anything as it uses SELECTS rather than actual DELETE on the tables but does show you the content of the $sql and what keys would get wiped out ...

Lat9's fix would add a safety on this portion of the code, and it needs to be done similarly on anything else doing DELETE in this file ...

At last.. thanks ladies.. It's not that I didn't believe there WAS a problem.. I just wasn't quite sure how it was an issue (thanks for the explanation lat9!! I GET IT now.. :laugh:) I will make the change and re-submit when I return from New York next week..

GIRL POWER ROCKS!!!
12 Apr 2014, 00:47
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Again, you might post your customizations for this file before you submit it to the add-ons to ensure the fixes are complete ...
12 Apr 2014, 03:37
#20
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Cross Sell Advanced [Support Thread]

Ajeh:

Again, you might post your customizations for this file before you submit it to the add-ons to ensure the fixes are complete ...


yes ma'am will do!:cool: