Jump to content
kymation

[Addon] Modular Product Page (Bootstrap)

Recommended Posts

The Edge release is a moving target; it's constantly being changed. The Header Tag modules did not exist when this Addon was written, so they may not be compatible.

 

If you're going to use Edge, you need to be aware of these changes and be prepared to fix incompatible code. If you can't do that, stick with the Gold release. That never changes.

 

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

thanks Jim,

 

I just try this addon also at the GOLD version, but the same thing happen... product title not showing at the browser tag, and also I just found out that the product name also not shows at the breadcrumb trail

 

regards,

pit

Share this post


Link to post
Share on other sites

The Gold version has no code to product a head title. You would need to install a module to do that. You can use the module from the Edge release or one of the Addons. Any header tag module designed for the 2.3 series should work.

 

Likewise, there is no code in Gold to add anything to the breadcrumbs on the Product Info page. There is no solution for that right now. I will probably write a module for that someday.

 

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

Hi!

 

I have the same problem with the undefined variable new_price! I'm not that good with php so could anybody just simply show what i need to replace so it will work properly! I tried the code above but it just showed the regular price! Maybe it's just my lack of knowledge of php but some help would be great! 

 

I'm currently redesigning a store on Oscommerce Bootsrap 2.3.4

 

 

Thanks!

Share this post


Link to post
Share on other sites

@@sfilip  You just need to install the Price module and it will work. If you’re trying to do something different, you need to give us more information to work on.

 

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

@@kymation i've installed the price module. I  have the same problem as @@katapofatico above. It won't  show the discounted price, it just shows the old price and the new one is always 0,00. I tried to fix it with the code above but i don't understand exactly what i need to do because i'm not that handy with php.

 

 

here's the error:

Notice: Undefined variable: new_price in D:\Program files\xampp\htdocs\responsive\includes\modules\content\product_info\cm_pi_price.php on line 41

Share this post


Link to post
Share on other sites

That gives me enough information to find the bug. Find this line in includes/modules/content/product_info/cm_pi_price.php:

          $products_price = '<del>' . $currencies->display_price( $product_info->products_price(), tep_get_tax_rate( $product_info->products_tax_class_id() )) . '</del> <span class="productSpecialPrice" itemprop="price" content="' . preg_replace('/[^0-9.]*/', '', $currencies->display_price($product_info->special_price, tep_get_tax_rate($product_info->products_tax_class_id() ))) . '">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info->products_tax_class_id() )) . '</span>';

and change it to this:

          $products_price = '<del>' . $currencies->display_price( $product_info->products_price(), tep_get_tax_rate( $product_info->products_tax_class_id() )) . '</del> <span class="productSpecialPrice" itemprop="price" content="' . preg_replace('/[^0-9.]*/', '', $currencies->display_price($product_info->special_price, tep_get_tax_rate($product_info->products_tax_class_id() ))) . '">' . $currencies->display_price($product_info->special_price(), tep_get_tax_rate($product_info->products_tax_class_id() )) . '</span>';

Many thanks to @@sfilip for the clear description and the error message so I could find the bug. I'll update the Addons section as soon as I get a chance.

 

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

Hi @ll !

 

Has anyone an Ajax Price Updater per Attribute got to work with the Modular Product Page ?  :wacko:

 

SEE YA

Denzel.

Share this post


Link to post
Share on other sites

A price updater works on the Admin side, so the modular product page has nothing to do with that. Any of them should work.

 

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

Hi Jim,

 

thank you for your fast reply. I think I did not have explained it exactly enough. What I mean is a price update without loading the product page again,

if you add attributes to your article. Like this one: http://addons.oscommerce.com/info/8968

 

I have tried to get it to work, but no chance  :(

 

SEE YA

Denzel.

Share this post


Link to post
Share on other sites

I see now. That should be possible, but you would have to modify the Price module. I don't know of anybody who has done this.

 

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

I have tried already, but its difficult cause the changes affect the price and the options module... maybe Ill try again tomorrow, today my eyes are to small already -_- 

 

SEE YA

Denzel. 

Share this post


Link to post
Share on other sites

@@kymation

 

Jim, are the public class properties just for backwards compatibility so that if you do a global replace in your code for the product info array to the product info object things will still compile ?

Only a couple properties are set in the class, everything is pretty much retrieved straight from the database.

 

If you were to set a property, eg like calculating the tax inclusive prices once for the open graph / semantic data, how should that function be called ?

 

Also, the return line for the availability function needs fixing to

// CB BUG ?
//      return tep_get_products_special_price($this->products_id);
      return $availability;

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

Yes, I originally intended to design it to be backwards compatible, but that didn't work out very well. A lot of public variables are never used or only used internally and should be protected or removed.

 

I didn't consider the opengraph properties (other than what was already in the copy of osC Bootstrap that I was working from) so that would need to be coded in. You should only need to set the products_id to identify the product and most everything else follows from that. The only exception is the Attributes/Options, and I'm trying to ignore that can of worms.

 

Thanks for reporting the bug in the availability method. I'll fix that and post an update.

 

If you see any place this needs to be improved, or functions added, please let me know.

 

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

I'm hoping you can help, I have this addon install and I am trying to install option types v2 however it is asking for changes to be made to the product_info.php file. Can you point me in the direction of where those changes would be instead?

Share this post


Link to post
Share on other sites

Changes would be made in includes/modules/content/product_info/templates/cm_pi_options.php. I'll take a look at this and see if I can whip up a quick module. If you can test the result for me that would save a lot of time.

 

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

I had just started working on this when I got yet another request for a job that had to be done yesterday. I've got that handled (to the customer for testing now) so I plan to work on this some more today.

 

So far, I can say that Option Types is a mess. I'd love to rewrite it, but I'll probably have to be content with just patching it. It should be possible to adapt the Modular Product Page to work with it without major changes to Option Types. We'll see.

 

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

Paid work comes first of course. 

 

If you can get it working then it would be awesome. As I said I'm happy to test it if/when you do make some progress.

Share this post


Link to post
Share on other sites

After dealing with the 56,817 interruptions, I managed to hack this up and posted a link to the test code. Anybody who is interested is welcome to test. I should probably do that myself. After I get some sleep....

 

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

I'm having an issue with this addon - although the module files are in the correct places the option to install Product Data isn't in my admin->Modules->Header Tags. This is a fresh install with no other addons besides KISSit which hasn't got the product_info part installed.

 

Any ideas?

Share this post


Link to post
Share on other sites

The module should show up if it's in the right place. Try forcing a refresh of the page.

 

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

I am trying to install KissIT_image_thumbnailer_r26 addon, which points to 2 line changes in product_info code.

 

The first is:

 

      echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], NULL, NULL, NULL, 'itemprop="image" style="display:none;"');

 

 

and the next one

 

echo tep_image(DIR_WS_IMAGES . $pi['image'], '', '', '', 'id="piGalImg_' . $pi_counter . '"');

 

 

 

But i am using the modified product_info.php file and i cant find any of these references. I ve also searched all files of Kymations excellent addon, but with no luck. My oscommerce version is the 2.3.4 BS Gold

 

Can anyone please help?

Edited by 29gk

Share this post


Link to post
Share on other sites

All of the changes will be in catalog/includes/modules/content/product_info/templates/cm_pi_image.php. The first line is not exactly the same, so you need to look at the differences and merge in the changes.

 

The first change is on line 20:

      echo tep_image(DIR_WS_IMAGES . $product_info->products_image, NULL, NULL, NULL, 'itemprop="image" style="display:none;"');

The second is on line 43:

          echo tep_image(DIR_WS_IMAGES . $pi['image'], '', '', '', 'id="piGalImg_' . $pi_counter . '"');

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

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

×