Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wishlist 2.0 Support Thread


defender39

Recommended Posts

Yea I have had that problem before when I first installed it. Dunno why it did it, nvr really troubleshooted it, I just fixed it. Open up phpmyadmin (or fav database editor) and edit the wishlist table. You will see the "blank" entry's of the table in there. Just delete them out and you should be fixed. ;)

 

-Dennis

Link to comment
Share on other sites

Hi

 

Has anybody setup the wishlist so that the customer can set the sort order i.e 1-10?

 

I need to have it so the customer can put the most wanted item in position 1 and the least wanted in position 10 and also have the ability to change the sort order at any time. (update wishlist)

 

Any ideas on how i could go about implementing this?

 

Thanks

 

Mike

Link to comment
Share on other sites

Yea add a new field to your table, you can call it sort_order. Then add it into your query and sort by it. Add a text box, for the customer, to allow them to change what product on there wishlist should be 1st. ect... Then the customer can go through, add in there sort order numbers, then when they update it, it addes in the 1-10, and then it sorts by that field.

 

That should get you started ;)

 

-Dennis

Link to comment
Share on other sites

Well it has to have something to do with something else you have installed?  Install a base oscshop in a different folder, different database.  Then install the wishlist and make your box change to only display for logged in users with stuff in it.  If it works, then its something else you have tinkered with.  Then start backtracking.

In the stock shop the same error.

But on the dutch osC forum someone pointed me to the solution:

in includes/classes/split_page_result search for

      $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
     
     $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

and replace for

$offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
     
     if ($offset < 0) $offset = 0;

     $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

My servers use PHP 4.3.10 (Zend: 1.3.0) and MySQL 4.1.8 & 4.1.9

 

Hope this info is usefull for more people

Link to comment
Share on other sites

Thats because the install directions weren't updated when homewetbar uploaded his new version, or w/e...

 

Change this:

 

                <!-- Wish List 2.3 Start -->
               <td align="center" class="main"><?php echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. FILENAME_WISHLIST . '\';document.cart_quantity.submit();"'. ' action=add_wishlist'); ?></td>
               <!-- Wish List 2.3 End   -->

 

to this:

 

                <!-- Wish List 2.3 Start -->
               <td align="center" class="main"><?php echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '\';document.cart_quantity.submit();"'); ?></td>
               <!-- Wish List 2.3 End   -->

on product_info.php ;)

 

 

 

To Further comment on this as it didnt dawn on me at the time, but if a user browsers your site with cookies disabled, then they will lose there session and get logged out if you dont have this link this way. Or any other link for that matter in your site.

 

osCshop: Im glad you finally got that working, it didn't even dawn on me about that offset bug. I know the error you were getting was pointing to your split page results query, its just didnt hit me. Nice job.

Edited by dblake
Link to comment
Share on other sites

Yea add a new field to your table, you can call it sort_order.  Then add it into your query and sort by it.  Add a text box, for the customer, to allow them to change what product on there wishlist should be 1st. ect...  Then the customer can go through, add in there sort order numbers, then when they update it, it addes in the 1-10, and then it sorts by that field.

 

That should get you started ;)

 

-Dennis

 

Hi Dennis

 

Thanks for the above :thumbsup:

 

I have added a new field called sort_order in the wishlist table and put some values in 1,2,3... added it to the query, but the wishlist will now display the same product 3 times :blink:

 

Have i done the query correct?

    $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image, w.sort_order from " . TABLE_WISHLIST. " w, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by sort_order");

 

Thanks

 

Mike

Link to comment
Share on other sites

Change your query to this and let me know if it works.

 

 $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image, w.sort_order from " . TABLE_WISHLIST. " w, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and w.productw_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by w.sort_order");

Link to comment
Share on other sites

Change your query to this and let me know if it works.

 

 $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image, w.sort_order from " . TABLE_WISHLIST. " w, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and w.productw_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by w.sort_order");

 

 

nope, that gives me an error "1054 - Unknown column 'w.productw_id' in 'where clause'"

 

:-"

Link to comment
Share on other sites

Dennis

 

Am i going in the right direction with this?

 

    <?php echo tep_draw_input_field('sort_order[]', $products[$i]['sort_order'], 'size="1"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']); ?><br>

 

Is this any good?

 

The field displays fine, but, i am not sure how to display the current sort order.

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

I would like to change just 1 more thing;

Now if the wishlist is empty there's no box (Thanks Dennis).

In the box I've removed the link to the wishlist .

I've replaced the textlink to wishlist faq for a 20x14 info image that links to the faq.

 

In my menu I have a link "Wishlist".

It would be nice if the user is not registered/logged in the link points to wishlist faq.

In wishlist faq there should be a line like "If you have a account, please login(link) to show your wishlist. Else register(link) to use the wishlist function."

 

If a registered user uses the link in the menu he should go to the wishlist page.

If the wishlist is empty I want after "No products are in your Wishlist" the same Info image that I use in the box (wich links to the faq).

 

This way I think it looks much cleaner.

Not the skills to get this job done.

Maybe more people like the idea(?), help is welcome..

 

TIA

Link to comment
Share on other sites

osCshop

 

For the link to change you would need something like this

 

<?php
if (tep_session_is_registered('customer_id')) { echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>';
} else {
echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a></td>';
}

 

All i have done here is either display a "add to wishlist button" if logged in or "create account button" if not.

 

You could modify the above to display either a "wishlist" or "FAQ" link

 

Hope that helps

Link to comment
Share on other sites

In my menu I have a link "Wishlist".

It would be nice if the user is not registered/logged in the link points to wishlist faq.

In wishlist faq there should be a line like "If you have a account, please login(link) to show your wishlist. Else register(link) to use the wishlist function."

 

If a registered user uses the link in the menu he should go to the wishlist page.

If the wishlist is empty I want after "No products are in your Wishlist" the same Info image that I use in the box (wich links to the faq).

 

This way I think it looks much cleaner.

Not the skills to get this job done.

Maybe more people like the idea(?), help is welcome..

 

TIA

 

Use the same code that is used for the wishlist box. If(tep_session_is_registered.... that code is in the column right box, I think? Just follow suit. The code is universal and can be used everywhere.

Link to comment
Share on other sites

add a value="addin query for sortorder"

 

 

Dennis sorry to sound so dumb :huh:

 

But i have no idea what you mean

 

I created a new query

  $sort_order = tep_db_query ("select products_id, sort_order from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "'");

 

then i did a php echo to see what i was getting and it gave me this "Resource id #189" :blink: what the hell is that?

 

So i think i am getting well in the deepend now

 

have you got msn?

 

Thanks

 

Mike

Link to comment
Share on other sites

you didnt need to create a new query. With you input field, you know they have values. For example,

 

<input type="text" size="5" name="sort_order[]" value="<?php echo $products[sort_order]; ?>" />

 

 

Thats what I meant. That way when the page is loaded, it will load the stored value into the input box right away. You will have to add another submit button as an update then add another borror switch in so you can update your sort order ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...