Jump to content



Latest News: (loading..)

- - - - -

Need help with an awesome add-on (YMM by DunWeb)

oscommerce 2.3.1

  • Please log in to reply
10 replies to this topic

#1   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 04 July 2012 - 10:06 AM

Hello!

I am currently trying to perfect an amazing contribution called " Year Make Model (YMM) "Select Vehicle" box for Auto Parts web sites version 2.3.1 ".
Basicly, the contribution is a filter, it filters your auto parts catalog by "year of the vehicle, model and make" so you can see only the parts that fit your vehicle.

Contribution is working perfectly except for one little detail:

once you chose your vehicle, you get the parts for that vehicle, but when you switch categories, like say you go from "BRAKES" into "ALTERNATORS",
the filtration is gone, so the prospect, has to resubmit his vehicles information every time he changes categories creating frustration/waste of time resulting in some lost of sells.


I already posted in the original contributions thread, but from reading the entire thread, I noticed that theirs only one active contributor viewing that thread, DunWeb him self, but poor
guy already put so much effort in this contribution, I'm not sure if he has more time or even motivation to complete this final tweak. I was hoping more professionals could help if I post
here aswell.


From my understanding, I was told that the reason for this malfunction, is that the attributes variables don't get passed along to the categories.

The URL looks something like this when u do the first filter "http://localhost/index.php?Make=Acura&Model=TL&Year=2005"
Once you click on a category, it changes to somewhere around those lines: "http://localhost/index.php?Path=23"


I don't know how hard it is to do the changes, I've skipped 2 nights trying to fix this, but I simply lack the knowledge to fix this... I need help...

#2   dailce

dailce
  • Members
  • 519 posts
  • Real Name:Ilchy
  • Gender:Male

Posted 04 July 2012 - 02:23 PM

I think you just have to append the "?Make=Acura&Model=TL&Year=2005" to the links.

This is rough, I haven't used that contribution, but maybe something like:

if (isset($HTTP_POST_VARS['Make']) && isset($HTTP_POST_VARS['Year']) ){
//rewrite the links
$my_new_link = tep_href_link(FILENAME_DEFAULT, 'cPath=30' . '&' . $HTTP_POST_VARS['Make']) . '&' . $HTTP_POST_VARS['Year']));
}

My guess though is you have to figure out away to append the variables to all links on that page that bring you to another category.  Maybe you just have to add something like that code to your product menu?

Edited by dailce, 04 July 2012 - 02:26 PM.


#3   NodsDorf

NodsDorf
  • Members
  • 1,274 posts
  • Real Name:Don Ford
  • Gender:Male
  • Location:ohio usa

Posted 04 July 2012 - 02:42 PM

Hi Alex, we had custom coded a search 3 years ago for our parts it seems to be along the same lines as what Chris (DunWeb) has done.
http://www.rubberstore.com/catalog/product-search.php

Long story short I had to port this functionality across a few pages on our site. To keep the variables I used session_register to create global variables so I could pass them between pages. Thinking of what is going on with this search (I haven't used it) but would it make sense to ask the user what kind of car the have?, then store that in the session.. subsequent returns to the search would check if the session for car type is set then use that information to base the selections. At the very least holding the the car / make / model / year in sessions would eliminate a lot of re-selecting.

#4   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,398 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 04 July 2012 - 02:43 PM

tep_get_all_get_params()

#5   burt

burt

    Code Monkey

  • Community Team
  • 7,754 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 04 July 2012 - 02:54 PM

@multimixer is correct.  And I gave you the exact same advice in chat yesterday.

You need to pass tep_get_all_get_params through the links.
Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#6   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 04 July 2012 - 03:11 PM

@multimixer Hi George,
@burt Hi Gary,

I thank you for those advice, but I really don't know what that means... Can you please be a little bit more specific?... What file to I input the tep_get_all_get_params() ?? What does this function even do??

Do I add it in index.php??

I don't expect you to do the code for me, that's not what the forum is for, but if you could just be a little more specific please? This is my first eCommerce attempt, I am no pro yet :(



@dailce I am not sure what that code means, ill google it right away and figure it out and try to implement it! Thanks! :D

#7   dailce

dailce
  • Members
  • 519 posts
  • Real Name:Ilchy
  • Gender:Male

Posted 04 July 2012 - 03:32 PM

@multimixer and @burt have it right.

#8   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 04 July 2012 - 03:34 PM

@dailce Do you know what I exactly i need to do with the tep_get_all_get_params() function?? How do I pass tep_get_all_get_params through the links??

#9   dailce

dailce
  • Members
  • 519 posts
  • Real Name:Ilchy
  • Gender:Male

Posted 04 July 2012 - 03:44 PM

This may be what you are looking for, but again I'm not too familiar with that contribution.  Basically you need to try to pass the already set variables to the other links on the page, which in your case you are saying you want them to stick to the category menu.  Sorry it might be GET instead of POST.

$link = tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('Make','Model','Year')).'Make=$HTTP_GET_VARS['Make']&Model=$HTTP_GET_VARS['Model']&Part=all&Year=$HTTP_GET_VARS['Year']', 'NONSSL', false);

Like you said when you do a first filter your url looks like this:

http://localhost/index.php?Make=Acura&Model=TL&Year=2005

from this we can pull the Make, Model, and Year with

$themake = $HTTP_GET_VARS['Make']
$themodel =$HTTP_GET_VARS['Model']
$theyear =$HTTP_GET_VARS['Year']

So I think you just have to find a way to add these to your links.  In your category menu you may have a tep_href_link somewhere (could be more than one spot), and I think you just need to add the variables to it.

tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('Make','Model','Year')).'Make=$themake&Model=$themodel&Year=$theyear', 'NONSSL', false);

I would check that they are set with something like this:

if (isset($HTTP_GET_VARS['Year']) {
   $theyear =$HTTP_GET_VARS['Year']
}

Hope this helps in someway.

Edited by dailce, 04 July 2012 - 03:56 PM.


#10   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 04 July 2012 - 06:24 PM

@dailce So far I keep getting errors after errors T.T
That is a great lead thou, thanks a lot! I'll keep playing with it, maybe i'll get it to work :D

#11   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 08 July 2012 - 01:02 PM

@multimixer Hi george!

So I've finally managed to pass the variables into the URL from the categories section with Chris help. Here is the new code:

$categories_string .= '<a href="';
	  if ($tree[$counter]['parent'] == 0) {
		$cPath_new = 'cPath=' . $counter;
	  } else {
		$cPath_new = 'cPath=' . $tree[$counter]['path'];
	  }	  $categories_string .= tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params() . $cPath_new) . '">';
	  if (isset($cPath_array) && in_array($counter, $cPath_array)) {
		$categories_string .= '<strong>';
	  }// display category name
	  $categories_string .= $tree[$counter]['name'];
	  if (isset($cPath_array) && in_array($counter, $cPath_array)) {
		$categories_string .= '</strong>';
	  }	  if (tep_has_category_subcategories($counter)) {
		$categories_string .= '-&gt;';
	  }
	  $categories_string .= '</a>';

The variables get passed, but the filter still doesn't work... When I go to a different category, the filters attributes don't apply any more...

Can someone advice what I can do next??