Jump to content
Latest News: (loading..)

Recommended Posts

@@razgre

 

Hi Raz

 

Sorry, no solution that works yet. Still trying to figure out how the wishlist is build up.

Not really sure but i think the catalog/includes/classes/wishlist.php might be the key.

The wishlist is build up in a similar if not same fashion as the shopping cart page it uses the same checking function.

 

example this one  ($wishList->count_contents() > 0) the shopping cart uses ($cart->count_contents() > 0) i guess the wishlist and the shopping cart cannot be called on one page otherwise we end up with the situation that we have now.

I will keep looking to find a way to get this working since it is also in my interest since i use also a mini cart inside the header.

 

There is a "temporary" solution though. Not beautiful but it does the trick "for now".

 

 

Inside your header.php you could change the cart icon into a button that redirects to the shopping cart if clicked.

Example;

<?php

 if ($PHP_SELF == 'wishlist.php') {

echo '<a class="btn btn-block btn-lg" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><i class="icon-basket-1 icon-large"></i></a>';

} else {

SHOW YOUR MINI CART CODE

}

?>

That should fix it till we get a better solution.

 

@@Tsimi

 

Thanks for your help. I didn't have a chance to check the code. I am busy with few project. I hope I will have a time this weekend to check the code. If I find some I will share with you and others.

Share this post


Link to post
Share on other sites

@@razgre

 

I think I got somewhere here with this Mini Cart issue. But before I start to post codes I need to explain something.

 

When you log in and start to create a wishlist the admin can see that wishlist contents in the admin area under the "Reports" area.

When the admin then clicks on the View Public Wish List button he gets redirected to the wishlist_public.php page.

Then if he adds products from the wishlist to the cart the added products will show the red "item is in cart" message.

The checkbox is deactivated and the input field for the quantities also. The added items to the cart still stay in the wishlist though.

This as said only happens if the "admin/shopowner" access the customers wishlist, which in my opinion is a rather rare thing to happen.

Otherwise the wishlist behaves as it was before, this time including the Mini Cart in the header area.

 

I will now past links to pastebin where you can then copy and paste the file contents. Before doing so please backup your files just in case.

After the install please test the wishlist and all it's functions again just to make sure there are no hiccups.

If you use the wishlist box or the wishlist footer module please add the OPTIONAL changes.

 

FOR ALL THOSE OUT THERE THAT "DON'T" HAVE A MINI CART INSIDE THE HEADER, PLEASE IGNORE THE FOLLOWING FILE CHANGES.

 

Modifications for users with a mini cart function inside the header. (header is not navbar! if you have a mini cart inside the navbar everything works just fine without the modifications below.)

 

 

catalog/includes/classes/wishlist.php

http://pastebin.com/qzpTWKKi

catalog/wishlist.php

http://pastebin.com/gkCb28fF

catalog/wishlist_public.php

http://pastebin.com/HygQFQPC

OPTIONAL:
----------------

boxes module

http://pastebin.com/YbBThn4N

footer module

http://pastebin.com/tp4emuH1

Edited by Tsimi

Share this post


Link to post
Share on other sites

Hello @@Tsimi

 

Thanks for your suggestion.

 

I have changed as you suggested but got the following error

 

Fatal error: Call to undefined method wishlist::get_products() in /includes/modules/boxes/bm_wishlist.php on line 40

Share this post


Link to post
Share on other sites

I was curious can you change the color of the add to wishlist? say to red? I am new to this bootstrap version and kind of cinfused on how you change color of the buttons, etc. I remember old oscommerce was like tep_draw_button('image_button_name','triangle-1e'); something like that

Share this post


Link to post
Share on other sites

@@drillsar

 

you have two possibilities

 

1.) pre-defined Bootstrap colors (btn-info, btn-success, btn-warning, btn-danger)

<?php echo tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', null, 'primary', array('params' => 'name="wishlist" value="wishlist"'), 'btn btn-danger'); ?>

2.) custom colors (you can change the color code inside the css to match your design.)

 

add this to your users.css

 

    .btn-red {
          background: #e74c3c;
          color: #fff;
          border: none;
          -moz-box-shadow: none !important;
          -webkit-box-shadow: none !important;
          box-shadow: none !important; /* !important tags aren't necessarily always bad */
    }
    .btn-red:hover, .btn-red:focus {
          background: #c0392b;
          color: #fff;
          transition: all 0.3s ease 0s;
        -webkit-transition: all 0.3s ease 0s;
           -moz-transition: all 0.3s ease 0s;
        -ms-transition: all 0.3s ease 0s;
        -o-transition: all 0.3s ease 0s;
    }
    .btn-red:active {
          background: #c0392b;
    }

 

and change the button code to

<?php echo tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', null, 'primary', array('params' => 'name="wishlist" value="wishlist"'), 'btn-red'); ?>
Edited by Tsimi

Share this post


Link to post
Share on other sites

is the sorting option on the product listings page going to be changed or is it going to be kept the same?

 

Instead of a - and a + symbol,

 

there can be "sort by A to Z", "Sort by lowest to highest price", "Best Selling", "Featured".

 

Whats the best way to get this functionality without having to edit the core code on 2334BS?

if anyone has already done it, let me know.

 

this is an important feature for an online shop.

Share this post


Link to post
Share on other sites

instead of going to wish list its adding to cart???

 

this is what I have in product_info

<div class="buttonSet row">
    <div class="col-xs-4 col-sm-4"><?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'glyphicon glyphicon-comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></div>
	<div class="col-xs-4 col-sm-4"><?php echo tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', null, 'primary', array('params' => 'name="wishlist" value="wishlist"'), 'btn btn-danger'); ?></div>
    <div class="col-xs-4 col-sm-4 text-right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'glyphicon glyphicon-shopping-cart', null, 'primary', null, 'btn-success'); ?></div>
  </div>

Share this post


Link to post
Share on other sites

@@Tsimi thanks very much ... Installed today with only a 2 very minor hiccups.

 

This was mentioned previously.... the sql import failed. I had left Do not use AUTO_INCREMENT for zero values checked and it to fail the on the configuration tables.

 

I just removed the one entry that actually got imported into the configuration table (with an id of 0) and copy & pasted the sql.

 

To test I removed all table changes and re-imported to with Do not use AUTO_INCREMENT for zero values UN_CHECKED and it worked perfectly.

 

I'm useless with mysql and no help to improve or fix.

 

Only other thing I ran into was the final line of code changes run together in the install.txt file (or at least my file).

 

 

        tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where customers_id = " . (int)$customers_id);****************************************************************************************************
 THAT'S IT!
****************************************************************************************************

Share this post


Link to post
Share on other sites

@@greasemonkey

 

Thanks for the report Scott.

 

I fixed the sql query I think it should work now either with or without AUTO_INCREMENT checked.

DROP TABLE IF EXISTS customers_wishlist;
CREATE TABLE customers_wishlist (
  customers_wishlist_id int unsigned NOT NULL auto_increment,
  customers_id int unsigned NOT NULL default '0',
  products_id tinytext NOT NULL,
  customers_wishlist_quantity int(2) NOT NULL,
  final_price decimal(15,4),
  customers_wishlist_date_added char(8),
  PRIMARY KEY  (customers_wishlist_id),
  KEY idx_wishlist_customers_id (customers_id)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

DROP TABLE IF EXISTS customers_wishlist_attributes;
CREATE TABLE customers_wishlist_attributes (
  customers_wishlist_attributes_id int unsigned NOT NULL auto_increment,
  customers_id int unsigned NOT NULL default '0',
  products_id tinytext NOT NULL,
  products_options_id int unsigned NOT NULL default '0',
  products_options_value_id int unsigned NOT NULL default '0',
  PRIMARY KEY  (customers_wishlist_attributes_id),
  KEY idx_wishlist_att_customers_id (customers_id)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible ) VALUES ( '12954', 'Wish List Settings', 'Settings for your Wish List', '25', '1' );
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Max Wish List', 'MAX_DISPLAY_WISHLIST_PRODUCTS', '10', 'How many wish list items to show per page on the main wishlist page', '12954', '', now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Max Wish List Box', 'MAX_DISPLAY_WISHLIST_BOX', '4', 'How many wish list items to display in the infobox before it changes to a counter', '12954', '', now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Emails', 'DISPLAY_WISHLIST_EMAILS', '5', 'How many emails to display when the customer emails their wish list link', '12954', '', now(), now(), NULL, NULL);
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Wish List After Adding Product', 'WISHLIST_REDIRECT', 'Yes', 'Display the Wish List after adding a product (or stay on product_info.php page)', '12954', '', now(), now(), NULL, 'tep_cfg_select_option(array(\'Yes\', \'No\'),');

I tested it and it worked but would appreciate if you could run it again through your phpMyAdmin just to make sure.

 

Regarding the install manual, yes i forgot to hit the enter button there. :blush: Fixed now.

Once the sql is confirmed working I will upload it to the add-ons area.

 

Thanks

Share this post


Link to post
Share on other sites

And to make it complete here the uninstall sql query. Something that I intend to add to the update later on.

DROP TABLE IF EXISTS customers_wishlist;
DROP TABLE IF EXISTS customers_wishlist_attributes;
DELETE FROM configuration_group WHERE configuration_group_title LIKE 'Wish List Settings';
DELETE FROM configuration WHERE configuration_key LIKE 'MAX_DISPLAY_WISHLIST_PRODUCTS';
DELETE FROM configuration WHERE configuration_key LIKE 'MAX_DISPLAY_WISHLIST_BOX';
DELETE FROM configuration WHERE configuration_key LIKE 'DISPLAY_WISHLIST_EMAILS';
DELETE FROM configuration WHERE configuration_key LIKE 'WISHLIST_REDIRECT';

I tested it and it worked but here again...confirmation from someone else would be appreciated. Thanks.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Tsimi

 

Hi Lambros

 

Ive just done a complete reinstall of BS234 and added Wishlist using the above SQL in post 42

 

All seemed to work OK

 

Cheers

Grandpa

Share this post


Link to post
Share on other sites

New Version available!

 

addons.oscommerce.com/info/8665

 

What has changed? Here a short list;

    - Replaced all instances of FILENAME_ and TABLE_ (filenames.php and database_tables.php will become obsolete.)
    - SQL queries for install and uninstall are now integrated inside the new product_info module
    - changes to reports.php are not necessary anymore
    - removed wishlist help modal
    - added new feature to wishlist.php to add and remove recipients by button click

 

All these new features are courtesy of @@De Dokta! So all credits for these new changes go to him.
Thank you J.J.! :thumbsup:

 

Please report any bug reports here. Thank you.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Tsimi

I upgraded to this version, but when I press 'add to wishlist' it shows me Product not found!  and adres in url field like this: http:/example.com/aaaa/product_info.php?products_id=   

 

It is bug?

I have followed 'upgrade instructions'. 

Share this post


Link to post
Share on other sites

@@Tsimi

 

I now understand why it is so. I removed this line from product_info.php:

 

<div class="col-xs-6 text-right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'glyphicon glyphicon-shopping-cart', null, 'primary', null, 'btn-success'); ?></div>

 

 

what do You think, is there any solution, if I wanna remove that line (remove 'add to cart'button)? 

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

×