♥altoid Posted April 25, 2012 Posted April 25, 2012 In the all products file, you could change this line $listing_sql .= " order by pd.products_name"; to $listing_sql .= " order by p.products_ordered"; I have tested it but I think it iwill work. This is an interesting concept. Changing line 191 as above but including the DESC syntax, gives me the best sellers on the first page of all products, ordering my best sellers in descending order. Then using the letter keys, the display produces alphabetically listed items. Full takes to the products listed by best sellers in descending order The change initially duplicate what's in the best sellers box, but it may be useful in point out to customers right off what items are selling the best. Something to think about. Quote 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.
Jack_mcs Posted April 25, 2012 Author Posted April 25, 2012 The change I mentioned would only affect the main page. Once a letter is clicked on, different code is used. Below the code I mentioned are several lines like $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; Change each of those to add the p.products_ordered like the following and it will probably work correctly $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", p.products_ordered, pd.products_name"; Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
♥altoid Posted April 25, 2012 Posted April 25, 2012 The change I mentioned would only affect the main page. Once a letter is clicked on, different code is used. Below the code I mentioned are several lines like $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; Change each of those to add the p.products_ordered like the following and it will probably work correctly $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", p.products_ordered, pd.products_name"; I'll try this out on one of the shops for a while to see how it goes. I think that there's may be a greater chance of customer engagement if more popular (best seller) items popped up on the all products pages as opposed to strictly alphabetical. I realize this is also for the benefit of SEO, but I don't think a search engine would care of it was a best seller on page one vs the first product by alphabetical listing. Thanks Quote 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.
Mazi Posted April 26, 2012 Posted April 26, 2012 In the all products file, you could change this line $listing_sql .= " order by pd.products_name"; to $listing_sql .= " order by p.products_ordered"; I have tested it but I think it iwill work. This works like a charm, Jack. Thanks a lot for your help. Note that you should add ...DESC at the end of the line to have the best sellers on top of you all products list. Here is an example of the "Limesurvey Template Shop" where I am using the feature for the "View All Products" list. Quote
Jack_mcs Posted April 26, 2012 Author Posted April 26, 2012 This works like a charm, Jack. Thanks a lot for your help. Note that you should add ...DESC at the end of the line to have the best sellers on top of you all products list. Here is an example of the "Limesurvey Template Shop" where I am using the feature for the "View All Products" list. I'm glad it worked out. And thanks for bringing it up since it isn't something I had thought about. I'll add it as an option in the next release. By the way, you may want to consider changing the display mode option. I think it would look better and provide an easier way to view the images. Just my opinion. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
♥joli1811 Posted May 18, 2012 Posted May 18, 2012 (edited) I don't support any contribution-specific changes in support threads because there are too many. Hi, for anybody wanting Jacks contribution integrated with accordion_categories_menu_1.1.2 here is the bm_categories_accordion.php John Edited May 18, 2012 by joli1811 Quote To improve is to change; to be perfect is to change often.
♥altoid Posted May 21, 2012 Posted May 21, 2012 Hi, for anybody wanting Jacks contribution integrated with accordion_categories_menu_1.1.2 here is the bm_categories_accordion.php John John, I did a work around to get the links in a different box, but if I would not have I'd may have used this code you provided. So thanks for posting. By the way..you'll see there is a new version of the accordion categories if you check that thread. Thanks again. Quote 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.
Diegosa Posted September 23, 2012 Posted September 23, 2012 Hi jack, The contribution works perfect, but I have two problems: 1. in Price List Categories are not shown because: <font color="#fff"> and <tr bgcolor="#FFFFFF"> how I can change it? 2. In Admin / Settings / All Products SEO I put "Price List - Show Quantity" to false, but still it shows the amounts . Any idea how to solve this ? I have installed OSC 2.3.3 Here you have an example where you can not see the category " Printers" (32) Matrox G200 MMS U$D 299.99 (31) Matrox G400 32MB U$D 499.99 Printers (8) Hewlett Packard LaserJet 1100Xi U$D 499.99 If you want I can send U a Link Thanks D Quote
Jack_mcs Posted September 23, 2012 Author Posted September 23, 2012 Hi jack, The contribution works perfect, but I have two problems: 1. in Price List Categories are not shown because: <font color="#fff"> and <tr bgcolor="#FFFFFF"> how I can change it? 2. In Admin / Settings / All Products SEO I put "Price List - Show Quantity" to false, but still it shows the amounts . Please try the price list code uploaded on the last page. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Diegosa Posted September 24, 2012 Posted September 24, 2012 Please try the price list code uploaded on the last page. it worked perfectly! You're an idol regards Quote
Roaddoctor Posted November 17, 2012 Posted November 17, 2012 Jack good morning. Just installed 1.3 and all seems good. Thank you! Because I use SPPC I think I need to make slight changes to all-products.php and price_list.php. I am noticing duplicate product entries in both when the products Specials price are different values for the respective customer groups. If the Specials price are all the same, all works well. It's been a while but if I recall correctly. I think I need to add this somewhere: // BOF Separate Price Per Customer // global variable (session): $sppc_customers_group_id -> local variable $customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } Then I need to adjust the queries with something like... and s.customers_group_id = ". (int)$customer_group_id. Am I on the right track? Woukld you be able to clarify this for me? Thank you! Quote -Dave
Jack_mcs Posted November 17, 2012 Author Posted November 17, 2012 Yes, that looks like the code you would need. No, I can't say for sure since I don't have a test shop setup with SPPC. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Roaddoctor Posted November 17, 2012 Posted November 17, 2012 For anyone else using SPPC, here are the modified code blocks for all-products and price_list pages /catalog/includes/functions/all-products.php // BOF Separate Price Per Customer // global variable (session): $sppc_customers_group_id -> local variable $customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } // list products determined group function AP_GetProducts($id_group, $width) { global $currencies, $languages_id; $query = ""; if(ALL_PRODUCTS_SEO_PRICE_SHOW_OUT_OF_STOCK == 'false') { $query = " and p.products_status = 1"; } $where = GetDisabledCats($where); $quotes = (defined('QUOTES_CATEGORY_NAME')) ? " and p.customers_email_address = '' and p.quotes_email_address = '' " : ''; $listing_sql = "select distinct pd.products_name, p.products_quantity, p.products_price, p.products_model, p2c.products_id, p2c.categories_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price FROM " . TABLE_PRODUCTS . " p inner join " . TABLE_PRODUCTS_DESCRIPTION ." pd on p.products_id = pd.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id inner join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id = p.products_id where p2c.categories_id = " . (int)$id_group . $query . $where . $quotes . " and pd.language_id = '" . $languages_id . "' and s.customers_group_id = ". (int)$customer_group_id." order by pd.products_name"; $products_query = tep_db_query($listing_sql); /catalog/all-products.php // BOF Separate Price Per Customer // global variable (session): $sppc_customers_group_id -> local variable $customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } $listing_sql = "select distinct p.products_id, p.products_weight, p.products_quantity, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on ( p.manufacturers_id = m.manufacturers_id ) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ( p.products_id = pd.products_id ) left join " . TABLE_SPECIALS . " s on ( p.products_id = s.products_id ) inner join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id inner join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id " . $where . $quotes . $bycategory . " and pd.language_id = '" . $languages_id . "'"; if ( (!isset($_GET['sort'])) || (! preg_match('/^[1-8][ad]$/', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $_GET['sort'] = $i+1 . 'a'; $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by pd.products_name"; // $listing_sql .= " order by pd.products_name"; // original code... SPPC changed above and below - to all $listing_sql break; } } } else { $sort_col = substr($_GET['sort'], 0 , 1); $sort_order = substr($_GET['sort'], 1); switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; // $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", p.products_ordered, pd.products_name"; // if you want sort by most popular -for all below lines... break; case 'PRODUCT_LIST_NAME': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_QUANTITY': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_IMAGE': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by pd.products_name"; break; case 'PRODUCT_LIST_WEIGHT': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_PRICE': $listing_sql .= " and s.customers_group_id = ". (int)$customer_group_id." order by p.products_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; } } Hope it helps others. Quote -Dave
Roaddoctor Posted November 19, 2012 Posted November 19, 2012 Jack, I've discovered a small issue. This may be just me though, I'm not sure. So, I use SPPC, QPB for SPPC, and the (evil) priceformater class... In both price_list and all-products, I am noticing that a product is not added unless an entry exists in Specials (special active or not active) for that product. i.e. if the product has just a basic price entry, with or without any QPB entries, and no special ever created, the product does not show. Any suggestions? I stared at queries all day yesterday and made no progress. Arghhh. Thanks again!! Quote -Dave
Jack_mcs Posted November 19, 2012 Author Posted November 19, 2012 Jack, I've discovered a small issue. This may be just me though, I'm not sure. So, I use SPPC, QPB for SPPC, and the (evil) priceformater class... In both price_list and all-products, I am noticing that a product is not added unless an entry exists in Specials (special active or not active) for that product. i.e. if the product has just a basic price entry, with or without any QPB entries, and no special ever created, the product does not show. Any suggestions? I stared at queries all day yesterday and made no progress. Arghhh. Thanks again!! No one has ever reported this problem. Pluse, I've never used the specials code in my shop and All Products works correctly. So it sounds like it is due to some change you've made. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Roaddoctor Posted November 21, 2012 Posted November 21, 2012 Jack me again. After installing, the all-products link appears in the sitemap (sitemap seo) Pages Group Control as it should , but NOT the price_list link... any idea on what could be wrong? I double checked /catlaog/includes/filenames php and the entry for both are there. define('FILENAME_ALLPRODS_SEO', 'all-products.php'); define('FILENAME_ALLPRODS_SEO_PRICE_LIST', 'price_list.php'); Also, should header_tags code be placed into the price_list.php file? Thanks again. Quote -Dave
Jack_mcs Posted November 21, 2012 Author Posted November 21, 2012 The price list code doesn't have its own language file. You can try adding one to the english (or whichever language you use). Just copy/rename the all products one and change the name for the heading. The rest isn't needed. That might fool the code into working. Or you can use the add a page option in box control of sitemap seo. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Roaddoctor Posted November 21, 2012 Posted November 21, 2012 Adding the language file did the trick. Thank you sir. Quote -Dave
♥14steve14 Posted December 8, 2012 Posted December 8, 2012 Jack I have a bit of a silly question. Whith the price list page is there any way to split the page results. With over a few thousand products the page is rather long. Only really need to split page on the full view version, not the print page version. Any help will be appreciated. Quote REMEMBER BACKUP, BACKUP AND BACKUP
Jack_mcs Posted December 8, 2012 Author Posted December 8, 2012 Yes, it's possible, though not coded. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
♥14steve14 Posted December 9, 2012 Posted December 9, 2012 I will have a lok and see if i can get it working. Quote REMEMBER BACKUP, BACKUP AND BACKUP
www.in.no Posted December 27, 2012 Posted December 27, 2012 Just installed this on a 2.3.3 shop and working mostly correct. The price list don't show prices with TAX if the configuration option in admin is set to show price with TAX. Is there a quick fix for this or can you add it in next version. Quote
Jack_mcs Posted December 27, 2012 Author Posted December 27, 2012 The tax shows correctly when I look at it here. The code just uses standard oscommerce code for that so besides having the show tax option set, the product has to have a tax class assigned and you have to be logged in for a location that the tax applies to. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
www.in.no Posted December 27, 2012 Posted December 27, 2012 @@Jack_mcs The problem is that it don't show with tax'es in the price_list.php but in all-products.php it does, and in the normal catalog it does. And it shows like that whether i am logged in or not. You can see it here osc.allmedia.no. It is in Norwegian but i think you know where to look. Any suggestions? I used the code posted a few pages back for price_list.php, modefyed design only.(I post that later) There are also a typing error in that code $breadcrumb->add(TITLE_PRICE, tep_href_link(FILENAME_ALLPRODS_SEO_PRICE_LIsT)); A lower case s in FILENAME_ALLPRODS_SEO_PRICE_LIsT Quote
Jack_mcs Posted December 27, 2012 Author Posted December 27, 2012 As mentioned, it works here. I just tried it again to check it under other languages in case that was the problem but it still worked. Are you sure you are using version 1.3 of this addon? Thanks for pointing out the typo. I do appreciate it. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.