s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Open to all! Ask other shopowners for help.
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by burt »

The only way to get such an error is an incomplete uninstall...

I'd just upload it all again.
Make sure that the DB tables are correct.
Turn it all on.
I am not here to build for you.
I am here to build with you. Let's help each other.

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
artfulweb
Contributor
Posts: 184
Joined: Thu Oct 29, 2020 12:34 pm
Phoenix Version: v1.1.0.6
Has thanked: 29 times
Been thanked: 14 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by artfulweb »

Must have been a problem in the database tables not visible to me. Wishlist works now. Will we ever know why it cannot be uninstalled without throwing a blank page on the product description with the class error as show earlier (just in case)?
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by BatteryTrader »

frankl wrote: Thu Nov 21, 2024 11:15 pm I thought it was?

Code: Select all

  class wishlist {

    public $contents, $total, $wishlistID, $content_type, $listID;

    public function __construct() {
      $this->reset();
    }
Worked for me, had the same PHP warning, changed in includes\system\versioned\1.07.other\1.0.7.12\wishlist.php

Thank you :+1:
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by 14Steve14 »

Has anyone created a shopping cart button that would give customers the ability to add items in their basket to their wishlist. I had a quick look and could not see a suitable hook next to the other buttons and dont really want to hack code unless I have to.
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by BatteryTrader »

I seem to have an action, not a hook

/includes/actions/wishlist_to_cart.php
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by 14Steve14 »

BatteryTrader wrote: Sun Jul 05, 2026 12:29 pm I seem to have an action, not a hook

/includes/actions/wishlist_to_cart.php
So how did you add the extra button in the cart page?
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by burt »

wishlist_to_cart and wishlist_all_to_cart actions, if I am not misremembering, I -think- moves item(s) From the wishlist To the cart. Note I haven't looked at the addon, certainly not in-depth, for a while.

It sounds like you want the opposite Steve? From cart To wishlist?

If that is true, `new button in cart` and a `new cart action "move all to wishlist"`, would be the way forward. Basically a reverse of `button in wishlist, wishlist action "move all to cart"`.

Does it sort of make sense? You're in the cart area, make it a cart button and cart action. It just so happens that something you want to do in the cart area, touches the wishlist area.
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by BatteryTrader »

Got one of those in the Actions too

wishlist_all_to_cart.php
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by BatteryTrader »

If it helps

Code: Select all

<?php
/*
  $Id$

  CE Phoenix, E-Commerce made Easy
  https://phoenixcart.org

  Copyright (c) 2025 Phoenix Cart

  Released under the GNU General Public License
*/

  namespace Phoenix\Actions;

  class wishlist_all_to_cart {

    public static function execute() {
      global $messageStack;

      class_exists('\cm_w_product_listing');

      foreach ($_SESSION['wishlist']->get_products() as $product) {
        $_SESSION['cart']->add_cart(
          $product->get('uprid'),
          $_SESSION['cart']->get_quantity($product->get('uprid')) + 1,
          $product->get('attribute_selections'));
      }

      $cart_link = $GLOBALS['Linker']->build('shopping_cart.php');
      $messageStack->add_session('product_action', sprintf(WISHLIST_ALL_PRODUCTS_SENT_TO_CART, $cart_link), 'success');

      // sending to cart from wishlist
      // redirect to cart or to wishlist?
      if (DISPLAY_CART === 'true') {
        \Href::redirect($cart_link);
      } else {
        \Href::redirect($GLOBALS['Linker']->build('wishlist.php'));
      }
    }

  }

14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: s07e01 - Wishlist / Faves QUESTIONS/SUPPORT

Post by 14Steve14 »

burt wrote: Sun Jul 05, 2026 12:36 pm wishlist_to_cart and wishlist_all_to_cart actions, if I am not misremembering, I -think- moves item(s) From the wishlist To the cart. Note I haven't looked at the addon, certainly not in-depth, for a while.

It sounds like you want the opposite Steve? From cart To wishlist?

If that is true, `new button in cart` and a `new cart action "move all to wishlist"`, would be the way forward. Basically a reverse of `button in wishlist, wishlist action "move all to cart"`.

Does it sort of make sense? You're in the cart area, make it a cart button and cart action. It just so happens that something you want to do in the cart area, touches the wishlist area.
You have it right. Its only an idea and not to sure if its even possible, but we have customers leave their cart full and I was just really looking for a way for them to save the contents of the cart into their wishlist either one at a time, or all at once. Like you say, the reverse of the add all to cart from the wishlist.

May have to send you a PM to get this sorted.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply