Jump to content
Latest News: (loading..)

Recommended Posts

Posted (edited)

Hi All,

Has anyone developed a 2.3.4 BS Module for: Displaying The Manufacturer's Name ( Link To All Products ) On The Product_Info.php Page of the website... Modules > Content Modules > Product Info > Manufacturer

Ideally it would Display the Manufacturer's Name and be Hyperlink to All of the Products by this Same Manufacturer...

Taking the user to... for example: /index.php?manufacturers_id=2

I did not see an add-on available, but wanted to ask the community for help first!

Thank You All!

Capture.JPG

Edited by Bobber
add info... picture

Share this post


Link to post
Share on other sites

Yes, there's a box module in the standard download - turn it on!


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

manufacturer_info.jpg


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Dear @BrockleyJohn,  @Bobber

It is correct that there is that box.

But I think the idea that the idea of  @Bobberis to have it as a Modules> Content Modules> Product Info instead of a box.

It would be a great addon if someone could do it.

Kiss

Valqui

 


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites
On 5/27/2018 at 2:05 AM, BrockleyJohn said:

Yes, there's a box module in the standard download - turn it on!

@BrockleyJohn I agree this box module is nice, but I want to have a module like this: Modules > Content Modules > Product Info > Manufacturer

Reason being: I think it would be more useful to the customer if manufacturer's name ( with a hyperlink to all of that manufacturer's other products ) was next to the model and gtin in the product info...

With mobile viewing and buying via eCommerce becoming much more important than they were before little details like this seem to be a big deal.

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Bobber said:

@BrockleyJohn I agree this box module is nice, but I want to have a module like this: Modules > Content Modules > Product Info > Manufacturer

Reason being: I think it would be more useful to the customer if manufacturer's name ( with a hyperlink to all of that manufacturer's other products ) was next to the model and gtin in the product info...

With mobile viewing and buying via eCommerce becoming much more important than they were before little details like this seem to be a big deal.

If you want an easy way to make your own module, you need a bit of @wHiTeHaT's magic: https://oscompose.com/

Create a product info content module and crib the code from the box for the execute function.

Edited by BrockleyJohn

For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

:sad: did not find it that simple as the manufacturers_name is not in the product_info.php file. It can be done but will require changes to core which is not good. Or have I missed somthing?

image.thumb.png.ee3e4128c243238f09822792e2127cb7.png

 


 

Share this post


Link to post
Share on other sites
Posted (edited)

@JcMagpie it doesn't need any changes to product_info.php

It needs a content module in the product_info directory. The existing code will load it if it is installed and enabled.

...though I don't off-hand remember how much of the page is modularised in "frozen". Earlier versions of Edge do need some clever stuff to get content high in the page.

Edited by BrockleyJohn
afterthought

For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
Posted (edited)
6 minutes ago, BrockleyJohn said:

@JcMagpie it doesn't need any changes to product_info.php

It needs a content module in the product_info directory. The existing code will load it if it is installed and enabled.

:wacko: I must be doing something wrong I have it working with no core changes to show manufactures_id works fine, But when I use manufactures_name nothing shows at all. Oh I just made copy of the product_name module and changed code to show manufacurers.

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites
1 minute ago, JcMagpie said:

:wacko: I must be doing something wrong I have it working with no core changes to show manufactures_id works fine, But when I use manufactures_name nothing shows at all.

post your execute function


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

This works fine I get the id showing with no change to core code

 const MODULE_CONTENT_PI_MANID_DISPLAY_MANUFACTURERS_ID = 'Manufacturer ID: %s';

Using same module changed for name give blank space on page, somethig is in the page as the layouut changes but no visable man name.

const MODULE_CONTENT_PI_MNAME_DISPLAY_MANUFACTURERS_NAME = 'Manufacturer: %s';

 


 

Share this post


Link to post
Share on other sites

again this works for id but not for name

 class cm_pi_mname {
    var $code;
    var $group;
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function __construct() {
      $this->code = get_class($this);
      $this->group = basename(dirname(__FILE__));

      $this->title = MODULE_CONTENT_PI_MNAME_TITLE;
      $this->description = MODULE_CONTENT_PI_MNAME_DESCRIPTION;
      $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>';

      if ( defined('MODULE_CONTENT_PI_MNAME_STATUS') ) {
        $this->sort_order = MODULE_CONTENT_PI_MNAME_SORT_ORDER;
        $this->enabled = (MODULE_CONTENT_PI_MNAME_STATUS == 'True');
      }
    }

    function execute() {
      global $oscTemplate, $product_info;
      
      $content_width = (int)MODULE_CONTENT_PI_MANID_CONTENT_WIDTH;
      
      $manufacturers_name = $product_info['manufacturers_name'];
      
      ob_start();
      include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__));
      $template = ob_get_clean();

      $oscTemplate->addContent($template, $this->group);
    }

 


 

Share this post


Link to post
Share on other sites

Changing this one line in product_info.php  and name works fine,

 

//$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_gtin from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

New,
    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "' and m.manufacturers_id = p.manufacturers_id");


 

Share this post


Link to post
Share on other sites

The easiest way to get what he asked is to start with a copy the execute function from the box module which does exactly what's wanted plus some other stuff:

    function execute() {
      global $languages_id, $oscTemplate;

      if (isset($_GET['products_id'])) {
        $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$_GET['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
        if (tep_db_num_rows($manufacturer_query)) {
          $manufacturer = tep_db_fetch_array($manufacturer_query);

          $manufacturer_info_string = NULL;
          if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<div>' . tep_image('images/' . $manufacturer['manufacturers_image'], htmlspecialchars($manufacturer['manufacturers_name'])) . '</div>';
          if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<div class="text-center"><a href="' . tep_href_link('redirect.php', 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(MODULE_BOXES_MANUFACTURER_INFO_BOX_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></div>';

          ob_start();
          include('includes/modules/boxes/templates/manufacturer_info.php');
          $data = ob_get_clean();
          
          $oscTemplate->addBlock($data, $this->group);
        }
      }
    }

Changing the query in the core page is, of course, more efficient though, but it should be a left join in case there isn't a manufacturer.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Please be kind I'm not a a coder! My plan was to simply offer a new product_info.php and they can backup the original ( quick and easy sorry) I will give your method a go in the morning. Thanks for the help.


 

Share this post


Link to post
Share on other sites

Not looking to take any crumbs from anyone, sorry you feel that way Gary. I am just getting to know the code and the best way to do that is to use it. My addons for what they are worth are just simple stuff which anyone with a bit of time could produce.

Thank you John and wHiTeHaT every bit helps. Oh and thanks for the https://oscompose.com/     Made life much simpler, getting on slowly but I’m in no rush. You can see my

feeble efforts so far, Still a few issues to sort out.

Thanks for all the help.

Zahid

 

image.thumb.png.5c7ec82e5a8a5a6abb1b2339e6704c38.png


 

Share this post


Link to post
Share on other sites

Ok almost done try it out on the test site and see if you have any issues. Just the modular page layout to sort out. Proving a bit tricky to get it to line up so many interactions with other stuff on the page. Oh and no need to worry about code! nothing new in it at all. All code is existing code. John was right simply took function from box and plonked it into new Module made using wHiTeHaT website tool.:thumbsup: was very easy to use. Thanks.

https://tbyb.co.uk

image.thumb.png.d6be6229cd5a8d23c4e6ad7c96edff83.png


 

Share this post


Link to post
Share on other sites

Dear @JcMagpie again thank you very much for the greats addons you make and the availability of always helping. 

I wish everyone had the same attitude as yours.

Just try your test site, and you can select manufacturers, but when you select one manufacturer its redirects you to the shopping_cart.php page and give the following messages:

Matrox G400 32MB has been added to your Cart
Your Shopping Cart is empty!

Best regards

Valqui


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites

I have split and hidden the shitty politics, apologies to all.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, valquiria23 said:

Dear @JcMagpie again thank you very much for the greats addons you make and the availability of always helping. 

I wish everyone had the same attitude as yours.

Just try your test site, and you can select manufacturers, but when you select one manufacturer its redirects you to the shopping_cart.php page and give the following messages:

Matrox G400 32MB has been added to your Cart
Your Shopping Cart is empty!

Best regards

Valqui

Ok you can download and try. Thank you to both BrockleyJohn and wHiTeHaT your input helped get this done much quicker.

John as you said the function from the box worked fine. The software builder saved a lot time as well thanks.

 

image.png.abae7c1c6c6cb73c13e42238a7870a1b.png

 

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

Dear Zahid @JcMagpie, Again thank you very much for your help.

Just install the addon and its work. 

But after the installation I receive this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/content/25/14014725/html/XXX/catalog/includes/languages/espanol/modules/content/product_info/cm_manufacturers_name.php:1) in /home/content/25/14014725/html/XXX/catalog/admin/includes/functions/general.php on line 38

Best regards.

Valqui

 


I'm using oscommerce Edge v2.3.4.1

Get here the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×