Forums / All Other Contributions/Addons / Select Product via Drop-Down for 1.3.9?

Select Product via Drop-Down for 1.3.9?

Started by iddy on 10 Aug 2011, 6:27 PM · Views: 834

Results 1 to 7 of 7
10 Aug 2011, 6:27 PM
#1
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Select Product via Drop-Down for 1.3.9?

Hi

i'm trying to install this mod on this test site ( http://motorcycleparts.ie/ )

the mod is only listed for 1.3.8 but when i install it i get the drop down box but nothing in it... but if i click in the drop down menu then it selects the product as intended.

So basically it works but doesnt show me the contents of the drop down box...

This code is from the mod so I'm assuming that something here is not compatible with 1.3.9?

Any pointers or help appreciated

Thanks

////////////////////////////////////////////////////////////////////////////////
// Add a drop down box for product selection - Ryan Garlick  - FrameTheTV.com

if ($_GET['main_page'] != 'advanced_search_result') {   // don't diplay the box on the search results page

  $testA = array();
  $testA = zen_get_categories_products_list($current_category_id);
  $testR = array();
  $drop_index = 0;

  foreach ($testA as $key => $value) {

     $testR[$drop_index] = array('id' => zen_href_link(zen_get_info_page($key),'cPath='.zen_get_generated_category_path_rev($_GET['cPath']).'&products_id='.$key.''), 'text' => zen_products_lookup($key, 'products_model'));
     $drop_index++;
  }

  sort($testR);

  echo "Product Selection: ";
  echo zen_draw_pull_down_menu('prodselect', $testR, '', 'onchange="window.location = this.options[this.selectedIndex].value"');
  echo "<br /><br />";

}
// end of drop down box for product selection
///////////////////////////////////////////////////////////////////////////////
11 Aug 2011, 9:48 PM
#2
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Select Product via Drop-Down for 1.3.9?

Ok I figured out where i was going wrong.:oops:

I wasn't using the product model field and this line of code calls for that... :blush:

$testR[$drop_index] = array('id' => zen_href_link(zen_get_info_page($key),'cPath='.zen_get_generated_category_path_rev($_GET['cPath']).'&products_id='.$key.''), 'text' => zen_products_lookup($key, 'products_model'));
  

Just in case anyone else is looking to use this mod you can also change 'products_model' to 'products_name' to get the drop down to use the product name field instead

11 Aug 2011, 10:29 PM
#3
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,892
Plugin Contributions:
20

Re: Select Product via Drop-Down for 1.3.9?

The $GET is going to become problematic with PCI compliance and versions of Zen Cart beyond 1.3.9h.
Might want to contact the mod creator or look for a support thread to fix the possible security problem.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

13 Aug 2011, 8:06 AM
#4
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Select Product via Drop-Down for 1.3.9?

Hi

The mod is working now but I cant see any logic to the way its displaying the products. The main listing is alphabetical but the drop down doesnt seem to be in any particular order. I've set the sort order but i cant see it doing anything..

Can some one take a look at it for me please?

http://motorcycleparts.ie/index.php?main_page=index&cPath=2_3_4_7&sort=20a&alpha_filter_id=0

Thanks

13 Aug 2011, 8:56 AM
#5
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Select Product via Drop-Down for 1.3.9?

I've just noticed that I uploaded a very big file by mistake... that might have something to do with the sorting issues. I'll upload a smaller file later and see how that works..

15 Aug 2011, 12:29 PM
#6
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Select Product via Drop-Down for 1.3.9?

Hi

I've figured out that the drop down box is listing products in model number order. Can anyone tell me how to get it to list in product name order?

Thanks

17 Aug 2011, 12:16 PM
#7
iddy avatar

iddy

Zen Follower

Join Date:
Jan 2009
Posts:
119
Plugin Contributions:
0

Re: Select Product via Drop-Down for 1.3.9?

i finally sorted this out so just in case anyone else runs into the same issues...i took another look at the categories and it turns out the drop down box is sorting by product id which is why some listings didnt look correct. the commercial version of easypopulate allows you to assign product id when entering products so i can upload product in the order i want them to appear in the drop down.

someone might be able to confirm if any free mod also allows the product id to be assigned.