Wishlist Updating when deleting, Wishlist quantity

  • Posts: 24
  • Thank you received: 0
8 years 11 months ago #197772

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.39
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : Not Applicable

Hello,

1. When I delete a wishlist item in the backend, it does not remove it from the frontend. However, it does update the total quanitiy/price as if the item is not there.

2. We need quantity to update when a user purchases an item on a wishlist. We are using it as a gift registry. For example, if the wishlist originally had 3 plates, after a user adds one to cart, it should only have 2 remaining. So that people don't get too many. Can we pay you for this customization?

I will fill out contact form with login info.

Thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #197821

Hi,

This behavior is related on your second question, if a customer buy an item from the wishlist the quantity of the products of this wishlist should already be decremented.

Once all the items are bought, we let the product in the wishlist even if its quantity is "0", that way the wishlist's owner can see what has been purchased, what is left, etc.

The following user(s) said Thank You: JennyCo

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 11 months ago #197930

When does the quantity go down?
After the purchase is confirmed? I tried to mock a purchase and it did not affect the cart. I went into back end and changed order to completed.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #197982

Hi,

Thanks for the report, it seems that we indeed have an issue.
We will fix that as soon as possible and keep you informed once it is done.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #197989

Hi,

Please edit the file "components/com_hikashop/views/cart/view.html.php" and in the function "showcart()" replace:

		if($cartVal->cart_type == 'wishlist' && $user == $cartVal->user_id){
			$query='SELECT a.*,b.* FROM '.hikashop_table('order').' AS a LEFT JOIN '.hikashop_table('order_product').' AS b ON a.order_id=b.order_id WHERE b.order_product_wishlist_id ='.(int)$cart_id;
			$database->setQuery($query);
			$buyers = $database->loadObjectList();
			foreach($buyers as $j => $buyer){
				foreach($rows as $k => $row){
					if($row->product_id == $buyer->product_id){
						if($buyer->order_user_id == $user){
							$rows[$k]->bought[$j] = JText::_('ORDER_NUMBER').": ".$buyer->order_id;
						}else{
							$userClass = hikashop_get('class.user');
							$user = $userClass->get($buyer->order_user_id);
							if(!empty($user->username)){
								$rows[$k]->bought[$j] = $user->username;
							}else if(!empty($user->user_email)){
								$rows[$k]->bought[$j] = $user->user_email;
							}else{
								$rows[$k]->bought[$j] = JText::_('HKASHOP_USER_ID').": ".$buyer->order_user_id;
							}
						}
					}
				}
			}
		}
By:
		$confirmedStatus = $config->get('invoice_order_statuses','confirmed,shipped');
		$confirmedStatus = explode(',',$confirmedStatus);
		
		if($cartVal->cart_type == 'wishlist' && $user == $cartVal->user_id){			
			$query='SELECT a.*,b.* FROM '.hikashop_table('order').' AS a LEFT JOIN '.hikashop_table('order_product').' AS b ON a.order_id=b.order_id WHERE a.order_status IN ('.implode(',',$database->quote($confirmedStatus)).') AND b.order_product_wishlist_id ='.(int)$cart_id;
			$database->setQuery($query);
			$buyers = $database->loadObjectList();
			foreach($buyers as $j => $buyer){
				foreach($rows as $k => $row){
					if($row->product_id == $buyer->product_id){
						if($buyer->order_user_id == $user){
							$rows[$k]->bought[$j] = JText::_('ORDER_NUMBER').": ".$buyer->order_id.' - '.$buyer->order_product_quantity.' '.JText::_('HIKASHOP_ITEM');
						}else{
							$userClass = hikashop_get('class.user');
							$user = $userClass->get($buyer->order_user_id);
							if(!empty($user->username)){
								$rows[$k]->bought[$j] = $user->username.' - '.$buyer->order_product_quantity.' '.JText::_('HIKASHOP_ITEM');
							}else if(!empty($user->user_email)){
								$rows[$k]->bought[$j] = $user->user_email.' - '.$buyer->order_product_quantity.' '.JText::_('HIKASHOP_ITEM');
							}else{
								$rows[$k]->bought[$j] = JText::_('HKASHOP_USER_ID').": ".$buyer->order_user_id.' - '.$buyer->order_product_quantity.' '.JText::_('HIKASHOP_ITEM');
							}
						}
						// Decrement the product qty
						$rows[$k]->cart_product_quantity -= $buyer->order_product_quantity;
					}
				}
			}
		}

The following user(s) said Thank You: JennyCo

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 11 months ago #198116

That worked! Thank you very much.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 10 months ago #202494

1. When a purchase is made directly from a wish list rather than through the main shopping cart, an automated payment notifications email confirming the order and detailing the products purchased is not being sent. Payment notification emails are coming through for other purchases, just not orders directly from a wish list.

2. If a product is unpublished so it no longer displays as available to purchase, the product continues to remain visible on a wish list. Is there a way to unpublish products that will remove if from wish lists as well?

3. Once an item is on a wish list, we can’t delete items. Selecting the action to delete does not remove the item from the wish list.

Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #202528

Hi,

1. Regarding the way the system is working, this issue is not logical. When coming from a wishlist, the wishlist is converted into a cart, a common cart, so once it is a cart the checkout is processed as the other regular carts. Are the same payment methods used for the tests ?

2. They should indeed be unpublished, thanks for the report, please edit the file "components/com_hikashop/views/cart/view.html.php" function "showcart()" and add the code:

			foreach($rows as $k => $row){
				if($row->product_parent_id != '0'){
					$found = 0;
					$parentPublished = 1;
					foreach($rows as $l => $row2){
						if($row2->product_id == $row->product_parent_id){
							$found = 1;
							if(!$row2->product_published)
								$parentPublished = 0;
						}
					}
					if(!$found || !$parentPublished){
						unset($rows[$k]);
					}
				}
				if(!$row->product_published)
					unset($rows[$k]);
			}
Right after the code:
		if(!empty($rows)){
			$variants = false;
			$ids = array();

3. If the owner of the wishlist remove a product, it is deleted from the wishlist. But if a third customer wxant to delete it, he can't. This choice is only for the owner of the wishlist. If it is not working in your case that's potentially because you don't have the latest version of the package. Please wait until the next release which should arrive shortly.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 10 months ago #202602

Thank you.

In response to your question of "Are the same payment methods used for the tests?" Yes, both transactions from the common cart and from the wishlist were using the same payment method. The checkout process functioned the same for both the wishlist purchase and purchase from the general cart. The lack of a payment notification email from the wish list was the only difference. Also, does the system allow the payment notification email to include which wish list items were purchased from?

Thanks again!

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #202900

Hi,

No the email don't mention from wich wishlist the products are coming.

Once the wishlist is transformed into a cart, only the type is changed, so the cart name is kept until the cart is transformed into an order. Once it is an order there is no more informations about the wishlist. That means that there is no more informations about the wishlist for the confirmation email.

If you are talking about a product from a wishlist which is added to the cart (so only one product of the cart) the product has the wishlist id in its informations.

So thanks to these informations the confirmation email can potentially be edited in order to add the desired data inside.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 10 months ago #203155

Thanks for your response.

As we are using the wish list feature as a gift registry, it is important that we can determine which items from an order are from specific wish lists. For example, if an order is completed with two products and one product was placed in the cart from one wish list and the second product on the order was placed in the cart from a different wish list, we need to know that both items were from wish lists and which wish lists they were from. Is there somewhere that the wish list id is tied to the product id on an order so we know if the purchased items were 1. purchased from a wish list vs. a general purchase and 2. which wish list they were purchased from as we have several wish lists.

Two additional wish list questions:

1. During the checkout process tax is not being charged to orders from wish lists; tax is being added to purchases not made from wish lists.

2. When a product from a wish list is added to the cart and an order is completed, should that item quantity automatically deduct from the wish list? Or is this something that needs to be manually updated?

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #203195

Hi,

So the products are added from a wishlist to the cart, it is not a wishlist which is converted into a cart, right ?
If it is, the wishlist id is stored in the order_product table, so you can retrieve this data in the product informations and display if the product is from a wishlist, and from which wishlist it comes.

1. The tax should be applied on the order, taxes are based on products, not on cart or wishlists, so even when you add an item to the cart from a wishlist, if the product is taxed, the taxed price must be present in the cart and then in the order.
I just tried on my end, and I confirm that it is working fine, please check your tax settings on the products.

2. The stock in the wishlist is automatically decremented when an order is completed. We made a little fix about that recently, so please install the latest version from our website with the latest fixes and install it over your current version. Or wait until the next release which should arrive soon.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 9 months ago #203577

Hi,

Thanks for the information.

Yes, the products are added from a wishlist to the cart. Where exactly is the wishlist ID located on the order page? I am not seeing a wishlist ID in the product list/product table. Is there somewhere else I should be looking for the wishlist ID to determine if purchased products are from a wishlist and which wishlist they are from?

One additional wishlist question:

On the back end when we put a product in a wishlist to zero quantity it completely removes the item from the wishlist, but the item remains visible on the front end with zero quantity listed. As the product is no longer on the back end, we are not able to adjust the product information. For example, if an item is returned we would want to add that item back to the wishlist. Should items be remaining visible on the back end in a wishlist after we change the item to a zero quantity?

Thanks again!

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 9 months ago #203615

Hi,

You have to add custom code to display the wishlist id, so in the view "order / show" (display of an order in frontend) you can add the code:

<th class="hikashop_order_item_wishlist_id_title title">
	<?php echo JText::_('WISHLIST_ID'); ?>
</th>
In the "thead" part and the following code in the foreach listing the products:
<td class="hikashop_order_item_wishlist_id">
<?php echo $product->order_product_wishlist_id; ?>
</td>

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 9 months ago #204631

We recently had a purchase from a wish list for an item where the quantity for the product was listed at zero (the item had already been fulfilled). Someone purchased the item from the wish list although it had been fulfilled and once the item was purchased, the quantity for the item read “-1” and the unit price read “Free.” The product on the backend has the correct price attached to it and the product shows the price if it is located through the general shopping cart. We do not want a product to list the price as “Free” in the wish list. Is there something we need to do to make sure the item maintains the correct pricing?

Thanks again!

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 9 months ago #204820

Hi,

Thanks for this report, please replace the content of the view "cart / listing_price" by:

	<span class="hikashop_product_price_full">
	<?php
	$config = hikashop_config();
	if(!($this->params->get('price_with_tax',false)))
		$this->params->set('price_with_tax', $config->get('price_with_tax','1'));

	if(empty($this->row->prices)){
		echo JText::_('FREE_PRICE');
	}else{
		$first=true;
		echo JText::_('PRICE_BEGINNING');
		foreach($this->row->prices as $price){
			if($first)$first=false;
			else echo JText::_('PRICE_SEPARATOR');
			if(isset($this->unit) && $this->unit){
				if(isset($price->unit_price))
					$price = $price->unit_price;
			}elseif($this->row->cart_product_total_quantity <= 0){
				$price->price_value = 0;
				$price->price_value_with_tax = 0;
			}
			if(!isset($price->price_currency_id))$price->price_currency_id = hikashop_getCurrency();
			echo '<span class="hikashop_product_price">';
			if($this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo JText::_('PRICE_BEFORE_TAX');
			}
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo JText::_('PRICE_AFTER_TAX');
			}
			if($this->params->get('show_original_price','-1')=='-1'){
				$config =& hikashop_config();
				$defaultParams = $config->get('default_params');
				$this->params->set('show_original_price',$defaultParams['show_original_price']);
			}
			if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
				echo JText::_('PRICE_BEFORE_ORIG');
				if($this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_BEFORE_TAX');
				}
				if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_AFTER_TAX');
				}
				echo JText::_('PRICE_AFTER_ORIG');
			}
			echo '</span> ';
			if(!empty($this->row->discount)){
				if($this->params->get('show_discount',3)==3){
					$config =& hikashop_config();
					$defaultParams = $config->get('default_params');
					$this->params->set('show_discount',$defaultParams['show_discount']);
				}
				if($this->params->get('show_discount')==1){
					echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START');
					if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){
						echo $this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id);
					}else{
						echo -1*$this->row->discount->discount_percent_amount.'%';
					}
					echo JText::_('PRICE_DISCOUNT_END').'</span>';
				}elseif($this->params->get('show_discount')==2){
					echo '<span class="hikashop_product_price_before_discount">'.JText::_('PRICE_DISCOUNT_START');
					if($this->params->get('price_with_tax')){
						echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id);
					}
					if($this->params->get('price_with_tax')==2){
						echo JText::_('PRICE_BEFORE_TAX');
					}
					if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
						echo $this->currencyHelper->format($price->price_value_without_discount,$price->price_currency_id);
					}
					if($this->params->get('price_with_tax')==2){
						echo JText::_('PRICE_AFTER_TAX');
					}
					if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)){
						echo JText::_('PRICE_BEFORE_ORIG');
						if($this->params->get('price_with_tax')){
							echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax,$price->price_orig_currency_id);
						}
						if($this->params->get('price_with_tax')==2){
							echo JText::_('PRICE_BEFORE_TAX');
						}
						if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
							echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id);
						}
						if($this->params->get('price_with_tax')==2){
							echo JText::_('PRICE_AFTER_TAX');
						}
						echo JText::_('PRICE_AFTER_ORIG');
					}
					echo JText::_('PRICE_DISCOUNT_END').'</span>';
				}
			}
		}
		echo JText::_('PRICE_END');
	}
	?></span>

And add the code:
						if($rows[$k]->cart_product_quantity < 0)
							$rows[$k]->cart_product_quantity = 0;
After:
						$rows[$k]->cart_product_quantity -= $buyer->order_product_quantity;
in the file "components/com_hikashop/views/cart/view.html.php" function "showcart()".

Last edit: 8 years 9 months ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 1 week ago #233266

Hello,

In topic # 202494 (item#2), you had given me code to update the wishlists if a product is unpublished.

After the last Hikashop update, this was obviously overwritten.

Do I still copy and paste the code you provided 9 months ago? Or has the code changed?


Thank you for your time:)

Last edit: 8 years 1 week ago by JennyCo.

Please Log in or Create an account to join the conversation.

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
8 years 1 week ago #233268

Hi,

As far as I can see, the modification is still the same for the latest version.
So it shouldn't be a problem.

Please Log in or Create an account to join the conversation.

  • Posts: 24
  • Thank you received: 0
8 years 1 week ago #233626

Thank you for your response.

Another wishlist question:
When I removed an item that had been purchased from a wish list on the backend it also removed the item completely from the front end of the wishlist. Previously, the item had remained on the front end and just showed a quantity of 0. This was a nice feature as we are using the wish list for wedding registry and couples and guests can view what products have been purchased and what is left to purchase.

Was this feature not included with the latest update? Please advise on how we can see previously purchased items in the wish list. Thank you for your time!

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 1 week ago #233767

Hi,

If you delete the product from the backend, so yes it will definitively remove the product from the cart.

But if the product is purchased by another customer, so the quantity will be decreased and even if the stock is 0, the product will be displayed. This is the way it is working by default. So in backend, instead of removing it, you should only decrease its quantity.

Please Log in or Create an account to join the conversation.

Time to create page: 0.113 seconds
Powered by Kunena Forum