Post by bull5-i » Fri Oct 07, 2011 3:12 pm

Well I've tested before with OC 1.5.1.1 and I double checked now with a clean install. I see no problems with the mod.
Do you have any other mods insalled that have modified the core files?

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm

Post by griffinrc » Fri Oct 07, 2011 8:57 pm

The only other module I installed as the "Welcome" for text on the Store front and that didn't modify any of the core files.

All that I did, was upload, installl, enable, go to a product listing and added text in the new tab. Saved changes and when I went view it I got this error .

Error No: 1064
SELECT COUNT(DISTINCT p.product_id) AS total FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND p.product_id IN (SELECT p2c.product_id FROM product_to_category p2c WHERE ) in /home/content/13/6473013/html/gemoc/system/database/mysql.php on line 49

Newbie

Posts

Joined
Fri Oct 07, 2011 1:49 am

Post by markman-b » Fri Oct 07, 2011 9:02 pm

What version of OC do you use???

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by griffinrc » Fri Oct 07, 2011 9:17 pm

v1.5.1.3.1

Newbie

Posts

Joined
Fri Oct 07, 2011 1:49 am

Post by bull5-i » Fri Oct 07, 2011 9:25 pm

Then why are using a mod for 1.5.1.1 which is different from 1.5.1.3.1 in many ways and would brake the OC. Please get the correct version.

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm

Post by griffinrc » Fri Oct 07, 2011 9:53 pm

I completely removed the modified files and replaced them with the original OC files. The error is now gone, I will look at another verison of the Custom Product Tab.

Newbie

Posts

Joined
Fri Oct 07, 2011 1:49 am

Post by markman-b » Fri Oct 07, 2011 10:01 pm

bull5-i wrote:Then why are using a mod for 1.5.1.1 which is different from 1.5.1.3.1 in many ways and would brake the OC. Please get the correct version.
I had that strange premonition, this was the cause....

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by griffinrc » Fri Oct 07, 2011 10:05 pm

lol, thanks. I installed CustomProductTab_1.5.1.3_v1.1.1 but now getting an error due to "specs " already exist in the database.

How would I locate that ?

Notice: Error: Duplicate column name 'specs'
Error No: 1060
ALTER TABLE product_description ADD specs TEXT NOT NULL in /home/content/13/6473013/html/gemoc/system/database/mysql.php on line 49

Newbie

Posts

Joined
Fri Oct 07, 2011 1:49 am

Post by bull5-i » Fri Oct 07, 2011 10:12 pm

I guess you did not uninstall the previous version. If installing/uninstalling and then again installing the new mod from the admin panel does not do the trick, then you would have to manually remove the column from the product_description table using the following sql statement "ALTER TABLE product_description DROP COLUMN specs" if you do not have a phpmyadmin interface to it in which case you could do the modification via the gui.

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm

Post by markman-b » Fri Oct 07, 2011 10:31 pm

bull5-i wrote:In catalog/controller/product/product.php is the evaluation of
$this->data['cpt_show'] = ....
This is (probably for your case) the only variable that is checked to display or not to display the tabs. You would have to make a separate variable for each tab if you want individual control for the tabs.

Hi Mate,

Below you can find my code in catalog/controller/product/product.php. I added these line 2 weeks ago or so.

Can to tell me what to do to hide the tab titled "specs6"? This tab is empy yet, but i might need it in future,

Code: Select all

$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs']));
            if ($this->config->get('custom_product_tab_status')) {
                $this->data['specs'] = html_entity_decode($product_info['specs'], ENT_QUOTES, 'UTF-8');
            }
			$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs2']));
            if ($this->config->get('custom_product_tab_status')) {
                $this->data['specs2'] = html_entity_decode($product_info['specs2'], ENT_QUOTES, 'UTF-8');
            }
			$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs3']));
			if ($this->config->get('custom_product_tab_status')) {
				$this->data['specs3'] = html_entity_decode($product_info['specs3'], ENT_QUOTES, 'UTF-8');
			}
			$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs4']));
			if ($this->config->get('custom_product_tab_status')) {
				$this->data['specs4'] = html_entity_decode($product_info['specs4'], ENT_QUOTES, 'UTF-8');
			}
			$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs5']));
			if ($this->config->get('custom_product_tab_status')) {
				$this->data['specs5'] = html_entity_decode($product_info['specs5'], ENT_QUOTES, 'UTF-8');
			}
			$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs6']));
			if ($this->config->get('custom_product_tab_status')) {
				$this->data['specs6'] = html_entity_decode($product_info['specs6'], ENT_QUOTES, 'UTF-8');

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by bull5-i » Fri Oct 07, 2011 10:45 pm

What you are doing wrong, is evaluating the $this->data['cpt_show'] over and over again, and it actually gets the value of the last evaluation, all the first ones are useless. You need to add a separate 'cpt_show' for each tab.
Try the following:

Code: Select all

$this->data['cpt_show'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs']));
$this->data['cpt_show2'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs2']));
$this->data['cpt_show3'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs3']));
$this->data['cpt_show4'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs4']));
$this->data['cpt_show5'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs5']));
$this->data['cpt_show6'] = $this->config->get('custom_product_tab_status') && ($this->config->get('cpt_always_show') || !empty($product_info['specs6']));
if ($this->config->get('custom_product_tab_status')) {
    $this->data['specs'] = html_entity_decode($product_info['specs'], ENT_QUOTES, 'UTF-8');
    $this->data['specs2'] = html_entity_decode($product_info['specs2'], ENT_QUOTES, 'UTF-8');
    $this->data['specs3'] = html_entity_decode($product_info['specs3'], ENT_QUOTES, 'UTF-8');
    $this->data['specs4'] = html_entity_decode($product_info['specs4'], ENT_QUOTES, 'UTF-8');
    $this->data['specs5'] = html_entity_decode($product_info['specs5'], ENT_QUOTES, 'UTF-8');
    $this->data['specs6'] = html_entity_decode($product_info['specs6'], ENT_QUOTES, 'UTF-8');
}
Remember to change the template file and put a separate cpt_showX check to each tab.

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm

Post by markman-b » Fri Oct 07, 2011 10:51 pm

Thanx for the correction. I'm not that skilled like you, otherwise i would have been the developer of Custom Product Tab :choke: :D :o

I''ll fix it and let you know the results.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by markman-b » Fri Oct 07, 2011 11:28 pm

Fixed! Thanx again for your fantastic support.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by markman-b » Sat Oct 08, 2011 4:48 am

Hi bull5-i,

Yesterday I posted a message in this OC upgrade topic:
http://forum.opencart.com/viewtopic.php ... 41#p205841

This was my question:
I'm using the commercial extension : "Custom Product TAB".
This extension enabled me to add 5 extra pages for each product. On these extra pages customers can find detailed productinfo. What will happen with the information (mostly text) on these pages when I uninstall and reinstall this extension? Lost????



This is the answer I received today given by user "uksitebuilder":
Depends on how the extension stores the data in the database. If stored in the settings table, the data will be gone when the extension is uninstalled. You should check with the extension developer

Can you tell me please what will happen with the data on the extra TAB pages I created, when I uninstall and reinstall your extension? These steps have to be taken when I want to update to OC version 1.5.1.3.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by bull5-i » Sat Oct 08, 2011 1:27 pm

Hey,

If you uninstall the mod, the database changes are reverted, meaning that the spec column is removed and all data will be lost.

You can avoid this if you uncomment the uninstall/install functions from admin/controller/module/custom_product_tab.php

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm

Post by markman-b » Sat Oct 08, 2011 6:17 pm

I suppose you're referring to this section:

Code: Select all

    public function install() {
        $this->db->query("ALTER TABLE " . DB_PREFIX . "product_description ADD specs TEXT NOT NULL");
        $this->load->model('setting/setting');
        $settings = array("cpt_show_always" => 0);
        $this->model_setting_setting->editSetting('custom_product_tab', $settings);
    }

    public function uninstall() {
        $this->db->query("ALTER TABLE " . DB_PREFIX . "product_description DROP COLUMN specs");
        $this->load->model('setting/setting');
        $this->model_setting_setting->deleteSetting('custom_product_tab');
    }
What to exactly? Putting two slashes // before and after this section?

By uncommenting this part of the code, I can upgrade OC in future safely?

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by bull5-i » Sat Oct 08, 2011 6:34 pm

A // before every line or /* at the beginning and */ at the end of the block.
I do not know what the future holds, but assuming the OC upgrades to not modify the table you should be on the safe side.

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm

Post by markman-b » Sat Oct 08, 2011 6:41 pm

bull5-i wrote:A // before every line or /* at the beginning and */ at the end of the block.
I do not know what the future holds, but assuming the OC upgrades to not modify the table you should be on the safe side.

Thanx mate. I'm not php skilled and used to quotes like "uncommenting". Used Google for it's meaning.
Thanx for confirming it.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by markman-b » Thu Oct 13, 2011 6:58 pm

I just upgraded OC to 1.5.1.3 and made the necessary Custom Product TAB changes by following the instructions written in the updated CPT manual. All info on my extra TABS is still there without any loss of data.

Thanx mate!

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by bull5-i » Thu Oct 13, 2011 8:39 pm

You're welcome!

|V|355 \/\/17|-| 7}{3 |3357, ... [you know the rest]

Commercial mods: New! Questions & Answers PRO - Admin Quick Edit PRO - Product Downloads PRO - Custom Product Tab PRO - New! Product Quick Edit Plus

All mods & extensions by me


Active Member

Posts

Joined
Tue Jan 11, 2011 8:49 pm
Who is online

Users browsing this forum: No registered users and 8 guests