Post by catman1 » Mon Sep 28, 2009 1:06 pm

I see how to prevent the display of the "Model:" information in product.tpl, but how can I remove the requirement to enter a "Model" description in the Admin in the first place? Are there any other dependencies related to the Model info that will be affected by removing this requirement or any good reasons to use model information when displaying one-of-a-kind items? The items will still be numbered consecutively in the database for the Admin's reference, correct?

New member

Posts

Joined
Tue Aug 11, 2009 12:12 pm
Location - Atlanta, GA, USA

Post by yegga » Fri Oct 02, 2009 6:09 pm

any answers for this?

Active Member

Posts

Joined
Tue Sep 08, 2009 5:03 am

Post by fido-x » Fri Oct 02, 2009 6:23 pm

In "admin/controller/catalog/product.php" (lines 881 to 883), find:

Code: Select all

if ((strlen(utf8_decode($this->request->post['model'])) < 3) || (strlen(utf8_decode($this->request->post['model'])) > 24)) {
	$this->error['model'] = $this->language->get('error_model');
}
And comment this out.

Then, in "admin/view/template/catalog/product_form.tpl" (lines 38 to 42) find:

Code: Select all

<td><input type="text" name="model" value="<?php echo $model; ?>" />
  <br />
  <?php if ($error_model) { ?>
  <span class="error"><?php echo $error_model; ?></span>
  <?php } ?></td>
and change to:

Code: Select all

<td><input type="text" name="model" value="<?php echo $model; ?>" /></td>
This will then make the "model" optional.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by yegga » Fri Oct 02, 2009 6:34 pm

and how does one remove display of 'Model' from product.tpl?

Active Member

Posts

Joined
Tue Sep 08, 2009 5:03 am

Post by fido-x » Fri Oct 02, 2009 6:54 pm

In "catalog/view/theme/TEMPLATE_NAME/template/product/product.tpl", remove the following code (lines 25 to 28):-

Code: Select all

<tr>
  <td><b><?php echo $text_model; ?></b></td>
  <td><?php echo $model; ?></td>
</tr>

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by catman1 » Sun Oct 04, 2009 11:56 am

Thanks much, fido-x!

New member

Posts

Joined
Tue Aug 11, 2009 12:12 pm
Location - Atlanta, GA, USA

Post by fido-x » Sun Oct 04, 2009 12:09 pm

No worries! Glad to be of assistance.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by coolnammy1 » Sat Oct 10, 2009 7:16 am

What if I just want to remove it from the product page at the store front? I tried to remove it from the .tpl file only, but it's not going through.

New member

Posts

Joined
Wed Sep 16, 2009 9:28 am

Post by fido-x » Sat Oct 10, 2009 10:02 am

coolnammy1 wrote:What if I just want to remove it from the product page at the store front? ...
fido-x wrote:In "catalog/view/theme/TEMPLATE_NAME/template/product/product.tpl", remove the following code (lines 25 to 28):-

Code: Select all

<tr>
  <td><b><?php echo $text_model; ?></b></td>
  <td><?php echo $model; ?></td>
</tr>
If you also wish to remove it from category pages, latest products (on the homepage), manufacturers, search, and special offer pages, you will also need to edit the following files:-
catalog/view/theme/TEMPLATE_NAME/template/common/home.tpl
catalog/view/theme/TEMPLATE_NAME/template/product/category.tpl
catalog/view/theme/TEMPLATE_NAME/template/product/manufacturer.tpl
catalog/view/theme/TEMPLATE_NAME/template/product/search.tpl
catalog/view/theme/TEMPLATE_NAME/template/product/special.tpl

Look for-

Code: Select all

<span style="color: #999; font-size: 11px;"><?php echo $products[$j]['model']; ?></span><br />
and remove it.
coolnammy1 wrote:I tried to remove it from the .tpl file only, but it's not going through.
Clear you cache (system/cache) by deleting all files except "index.html".

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by daysgonebyantiques » Sat Dec 26, 2009 10:09 pm

Silly 'dumb user' question...to comment out code, do I just put a # symbol in front of the section that needs to be commented out?

Days Gone By Antiques & Collectibles
FREE Continental US Shipping! Great gift ideas for ANY time of year!


Active Member

Posts

Joined
Sun Dec 13, 2009 10:02 pm


Post by daysgonebyantiques » Sat Dec 26, 2009 11:16 pm

Never mind, I found it. It's amazing what one can find out by doing a google search.

Days Gone By Antiques & Collectibles
FREE Continental US Shipping! Great gift ideas for ANY time of year!


Active Member

Posts

Joined
Sun Dec 13, 2009 10:02 pm


Post by daysgonebyantiques » Fri Jan 29, 2010 10:09 am

OK I did it before but didn't write down how I did it. I want to, when I'm adding a product, already have the tax class selected as VA Sales Tax. Where do I need to do the editing and what do I need to edit to make that happen?

Days Gone By Antiques & Collectibles
FREE Continental US Shipping! Great gift ideas for ANY time of year!


Active Member

Posts

Joined
Sun Dec 13, 2009 10:02 pm


Post by daysgonebyantiques » Fri Jan 29, 2010 8:33 pm

fido-x wrote:In "admin/controller/catalog/product.php" (lines 881 to 883), find:

Code: Select all

if ((strlen(utf8_decode($this->request->post['model'])) < 3) || (strlen(utf8_decode($this->request->post['model'])) > 24)) {
	$this->error['model'] = $this->language->get('error_model');
}
And comment this out.

Then, in "admin/view/template/catalog/product_form.tpl" (lines 38 to 42) find:

Code: Select all

<td><input type="text" name="model" value="<?php echo $model; ?>" />
  <br />
  <?php if ($error_model) { ?>
  <span class="error"><?php echo $error_model; ?></span>
  <?php } ?></td>
and change to:

Code: Select all

<td><input type="text" name="model" value="<?php echo $model; ?>" /></td>
This will then make the "model" optional.
After rebuilding my store, I tried this again and could not get it to work. No error messages or anything, I just could not add any products to my store, I didn't get that green 'success' message. ???

Days Gone By Antiques & Collectibles
FREE Continental US Shipping! Great gift ideas for ANY time of year!


Active Member

Posts

Joined
Sun Dec 13, 2009 10:02 pm


Post by daysgonebyantiques » Sat Jan 30, 2010 8:32 pm

fido-x wrote:In "catalog/view/theme/TEMPLATE_NAME/template/product/product.tpl", remove the following code (lines 25 to 28):-

Code: Select all

<tr>
  <td><b><?php echo $text_model; ?></b></td>
  <td><?php echo $model; ?></td>
</tr>
Instead of removing it, can you just comment it out?

Days Gone By Antiques & Collectibles
FREE Continental US Shipping! Great gift ideas for ANY time of year!


Active Member

Posts

Joined
Sun Dec 13, 2009 10:02 pm


Post by lbv2010 » Wed Jun 30, 2010 9:59 am

I removed lines 25-28 and now when I click on a product I get this error message: Parse error: syntax error, unexpected $end in /home/babywar1/public_html/catalog/view/theme/default/template/product/product.tpl on line 232

any ideas??

Newbie

Posts

Joined
Sat May 29, 2010 7:12 am

Post by Qphoria » Wed Jun 30, 2010 12:22 pm

You either left too much in or deleted too much.. like an extra "}" Start over and delete only what is shown

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by lbv2010 » Wed Jun 30, 2010 11:20 pm

how do I reset the default code?

Newbie

Posts

Joined
Sat May 29, 2010 7:12 am

Post by Qphoria » Wed Jun 30, 2010 11:42 pm

lbv2010 wrote:how do I reset the default code?
I think its best to let you figure that out

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by lbv2010 » Thu Jul 01, 2010 1:48 am

got it
Last edited by lbv2010 on Tue Jul 13, 2010 10:07 pm, edited 1 time in total.

Newbie

Posts

Joined
Sat May 29, 2010 7:12 am

Post by Qphoria » Thu Jul 01, 2010 2:53 am

really? how about "UPLOAD THE ORIGINAL FILE"

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: Google [Bot] and 7 guests