Jump to content

Archived

This topic is now archived and is closed to further replies.

burt

Open discussion on Better Navigation and Categories

Recommended Posts

@@kymation thanks for the suggestions and testing it :)

 

John and I did #3 (getting the image to show) in the online chat earlier. How do you feel about the recently viewed using the nav_history. I'm not 100% keen on the complicated array_etc in the box file - any thoughts appreciated.

 

Once we can decide that the module is "good", I'll build in some admin functions for it (how many to list, whether to show on a new page and so on).


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

testing and working on 2.3.3.4

5.4.21 php

5.1.68 msql

 

agree with Jim's points especially imagery. I saw John's shop he was testing images on and the images would tend to get the visitors attention once they start popping up. More so than text I believe.

 

I'd presume the image shown would be the "smaller" version from the product listing i.e. I try to keep those small images at 200x200 around 4 to 5 kb size for page loading.

 

I think this is a big deal to add to the mix from a site visitor point of view. I can see the customer going through several similar items and then with a glance at recently viewed pick out a favorite.

 

Thanks to Gary the coder and John the guinea pig.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

@@burt I was looking at that complicated line you used to extract the products list from the navigation history class. I think you could simplify that by adding a few lines to the navigation class to build a list of unique product IDs in the add_current_page() method. It would be a lot cleaner anyway.

 

I also agree that this is a good module to have. I have used the old Recently Viewed addon and it's a pain. A clean module with modern code would be very welcome.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

@@burt I was looking at that complicated line you used to extract the products list from the navigation history class. I think you could simplify that by adding a few lines to the navigation class to build a list of unique product IDs in the add_current_page() method. It would be a lot cleaner anyway.

 

I also agree that this is a good module to have. I have used the old Recently Viewed addon and it's a pain. A clean module with modern code would be very welcome.

 

Regards

Jim

 

That seems like a good idea. If we just passed the product_id's visited into a new array, it would be less intensive than what I have done...

I'll take a look.

 

Thanks Jim


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Recently Viewed Version 2

 

This version simplifies the array of viewed products and adds the products image.

 

Updated to VERSION 3:

http://forums.oscommerce.com/topic/395130-open-discussion-on-better-navigation-and-categories/page__st__20#entry1685472


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

recently viewed v2 looking and functioning well. :thumbsup:


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Recently Viewed v3.

- optimised the bm_viewed box to use less queries (getting the name, getting the image)

- limited the view to 5

- added button (if more than 5) to new recently_viewed page

- added recently viewed page

 

Let me know of any problems.

 

 

http://forums.oscommerce.com/topic/395130-open-discussion-on-better-navigation-and-categories/page__st__40#entry1685524 (v4)


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

hi gary,

I had a quick glance at the code, I wondered if the recently_viewed page could not use the product listing module ?

I like to avoid dupication of code sections, I have on my site the products_new and specials pages use the product listing module so the look is uniform across pages


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Yeah, it could do - why not. The recently_viewed page is just a copy of products_new pretty much.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Working fine by me got an undefined sql error at the beginning when upgrading but cleared browser cache and settled down :D

so working now looks great strange it was not done before just shows what a bit of discussion can do.

 

Think these open discussions are really moving things forward

Many thanks for your time and skill Mr Burt the man with the Fez no beer today but here is something else


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Version 3 is working correctly on my test store. Same setup as before.

 

One caveat: I don't think the current product should show in the Recently Viewed box. I don't need the reminder when I'm currently looking at it. If other people disagree, then please make this an option.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

One caveat: I don't think the current product should show in the Recently Viewed box. I don't need the reminder when I'm currently looking at it. If other people disagree, then please make this an option.

 

I agree with this.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

It's definitely a nice idea - can you try the changes below and make better ?

 

/includes/classes/navigation_history.php

 

Find:

if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) {
 if (!is_array($this->products)) $this->products = array();
 $products_id = tep_get_prid($HTTP_GET_VARS['products_id']);
 if (!in_array((int)$products_id, $this->products)) {
   $this->products[] = (int)$products_id;
 }
}

 

Change to:

if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) {
 if (!is_array($this->products)) $this->products = array();

 $products_id = tep_get_prid($HTTP_GET_VARS['products_id']);
 array_unshift($this->products, (int)$products_id);
}

 

/includes/modules/boxes/bm_viewed.php

 

Find:

     global $oscTemplate, $navigation, $languages_id;

     if (sizeof($navigation->products) > 0) {
       $viewed = implode(",", array_reverse($navigation->products));

 

Change to:

     global $oscTemplate, $navigation, $languages_id, $PHP_SELF;

     $products_viewed = $navigation->products;

     if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) {
       unset($products_viewed[0]);
     }

     if (sizeof($products_viewed) > 0) {
       $viewed = implode(",", array_unique($products_viewed));


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Here is a version that is session based so no database query is needed in the bm_viewed box module. Instead of the edit to the navigation class you add a small snippet to the product_info page. It's just my preference to try and avoid database queries if possible. Both @@burt version and mine seem to accomplish the same thing and all credit goes to him for coding everything up that the bulk of my version uses.

Recently Viewed Session Based.zip


Matt

Share this post


Link to post
Share on other sites

@@burt Thanks for the quick response. That works great. I've run out of ideas, so I'll just stop now.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

@@burt

v3...alls good and added the supplemental code per above. nice...very nice.

 

@@mattjt83

Matt...headed over another shop to install and test out the session based version.

 

Thanks to the professionals for sure.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Matt's version installed and working nicely on a 2.3.3.4 shop.

 

Men, coming from a webmaster/shop owners point of view both approaches are working well and I am happy with them. Thanks.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Thank you Gary for your work and dedication to help us osC'ers.

 

Also a big thanks to those who helped and tested.

 

Sorry I have been absent from the discussion and testing but have had a rather busy few weeks.

 

I will definately be installing this contribution... again BIG THANKS!!!

 

:thumbsup:


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

@@jhande - thanks for the kind words Jim.

I'm trying to get osc buzzing again, like in the old days.

It's a uphill struggle :D


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

@@burt

 

You are welcome Gary!

 

I'm right behind you... don't worry you won't fall backwards. :D


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

So, recently_viewed, one component of the nav/categories is done, whether by my full system or plugging in Matts part.

 

What should we concentrate on next ?


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

a modern ul / li based menu ? a choice for horizontal and/or vertical menu


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Excellent idea. It would be easy to change the existing menu to an unordered list. The store owner can then style it as they please. I've done this for a couple of addons (the Superfish menu is best) that could be used as a starting point. Feel free to clean up my code, or rewrite it completely if you want.

 

Most of the sites shown in the article use some form of horizontal menu. Offering this as an alternative to the column menu is a good idea.

 

One more idea: While identical subcategories in multiple categories is possible in osCommerce, the subcategory has to be created separately and then populated, which is a huge pain. Can we modify the category structure to allow a category to link to multiple parent categories? This would help a lot in accomplishing #2 on that list.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

×