What Should Happen When An Item Is Sold...

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 8 months ago #96955

I could swear I asked this question before but I can't find the post :(

When an item is SOLD, I would like it to remain on the site on the listings and product description pages.

PRODUCT LISTINGS:
When the product is sold out it disappears from the product listings page. I would like it to remain on the page and display a "Sold Out" button/message.

PRODUCT DESCRIPTION PAGE:
If the user clicks on the "Sold Out" product to view the description, I would like the "Sold Out" button/message to display the same way a badge displays.
Please see attached pic. as to how I would like the sold out button/message to look. I would prefer not to use the badge option as this is a lot of manual work.

I would like this to be automatic so that when an item is sold the badge displays on top of the product on both the listings and category page as per attached pic.

If this is a lot of work and I have to pay, please let me know what you would charge as this is important for the client.

Thanks very much!!!

Attachments:

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 8 months ago #97090

Hi,

You should turn on the option "Display out of stock products" of the configuration and of your products listing menus/modules.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 8 months ago #97092

Regarding the badge, if we add an option to support the quantity in the badges it could be done automatically with only one badge.

It's actually quite easy to add so we'll add that for next release.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 8 months ago #97177

Thanks for your help - really appreciate it!!

The client would like this option added before going live, which is in about a week. Any idea when the next release is?

Or can you tell me how to make the changes if the release will be longer than a week.

Thanks again!!

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 8 months ago #97191

The change is not that simple. It requires the database to be modified as well as several files.
The next release won't be before several weeks.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 8 months ago #97195

Oh ok. Thank you. I will let the client know. I guess I'll do it manually for her until the change is made.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 8 months ago #99444

The change is not that simple. It requires the database to be modified as well as several files.
The next release won't be before several weeks.


Is the above added in the latest version? I thought I saw it on the list of new features but I can't find the list anymore. Where do we find the list of features to each new update? I was reading them in the backend but after I updated the site I don't see it anymore.

Thanks!!

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
11 years 8 months ago #99578

Yes it is.

The change log can be seen here:
www.hikashop.com/en/support/documentatio...ashop-changelog.html

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 8 months ago #99770

Regarding the badge, if we add an option to support the quantity in the badges it could be done automatically with only one badge.


So how do I get this to work when an item is sold out? I looked but not sure. I tried putting "0" in the quantity field of the badge and I assumed that when an item hits "0" the badge will automatically show but that did not work.

Thanks!

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

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

Hi,

In the view "product / show_block_img" thanks to replace:

							if(!empty($this->element->badges))
								$this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0');
By:
							if(!empty($this->element->badges) && ($this->element->product_quantity == $config->get('badge_quantity','') || empty($config->get('badge_quantity',''))))
								$this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0');

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 8 months ago #99989

I have the most updated version (2.1.2) and I thought this was already added? Anyhow, I add the code you gave and is getting the error below when I click on a product.

Fatal error: Can't use method return value in write context in /home/.../public_html/.../templates/.../html/com_hikashop/product/show_block_img.php on line 56

This is the code in that section:

            <div style="position:relative;text-align:center;clear:both;width:<?php echo $divWidth;?>px;margin: auto;" class="hikashop_product_main_image_subdiv">            <?php echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width,  $height);
            if(!empty($this->element->badges))
                $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0');
            ?>
            </div>

Thanks!!

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

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

Hi,

Can you try this if condition:
if(!empty($this->element->badges) && @$this->element->product_quantity == @$this->element->badges[0]->badge_quantity )

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 7 months ago #101029

Hi Xavier,

PRODUCT LISTINGS:
When the product is sold out it disappears from the product listings page. I would like it to remain on the page and display a "Sold Out" button/message.

PRODUCT DESCRIPTION PAGE:
If the user clicks on the "Sold Out" product to view the description, I would like the "Sold Out" button/message to display the same way a badge displays.


This works fine now on the PRODUCT LISTINGS page but it does not show on the product description page as per above. I assume I need to move the code to another view as well? If so, where please?

<div style="position:relative;text-align:center;clear:both;width:<?php echo $divWidth;?>px;margin: auto;" class="hikashop_product_main_image_subdiv"> <?php echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width, $height); if(!empty($this->element->badges) && @$this->element->product_quantity == @$this->element->badges[0]->badge_quantity ); ?> </div> [code] Thank you very much for your help with this.[code]
<div style="position:relative;text-align:center;clear:both;width:<?php echo $divWidth;?>px;margin: auto;" class="hikashop_product_main_image_subdiv"> <?php echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width, $height);
if(!empty($this->element->badges) && @$this->element->product_quantity == @$this->element->badges[0]->badge_quantity );
?>
</div>
Thank you very much for your help with this.[code]

Thank you very much for your help with this.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #101104

Hi,

Just to be sure, you need to display the badge for the out of stock products on the product listing and on the product page, right ?

I just tried on my end, he badge set to display on products with a quantity of 0. And without any changes in the views or something else, the badge is displayed on the listing and on the product page.

Can you try to download the latest package from our website and install it over your current version ?
And remove the previous customizations ?

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 7 months ago #101216

I did what you suggested and it seems to work fine now.

Thank you very much for your help!!!!!!!!!!!!!!

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 3 months ago #122363

I just upgraded to current version of : HikaShop Business: 2.2.1

The badge on the "listings" page has disappeared but it is still showing on the description page. What could have changed this? How do I get it to show on the listings page again?

Thank you!!

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

  • Posts: 2334
  • Thank you received: 403
11 years 3 months ago #122673

HI there,

How did you edited the view with the code Xavier gave you?
If you didn't used the Hikashop view editor system (in Display>Views), the customization may have been erased by the upgrade. In this case, just edit your view and make the customization again.
If you file is still the same and has not been erased (meaning you did the modification through our system), tell me and I'll check if we modified our badges behaviour.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 3 months ago #123570

It looks like the code was erased - not sure why that would be as I'm using my template :( .

I have the most updated version (2.1.2) and I thought this was already added? Anyhow, I add the code you gave and is getting the error below when I click on a product.

Fatal error: Can't use method return value in write context in /home/.../public_html/.../templates/.../html/com_hikashop/product/show_block_img.php on line 56

I am getting the same error I got when I initially added the code. I am now using version: 2.2.1

Thank you!!

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

  • Posts: 26165
  • Thank you received: 4029
  • MODERATOR
11 years 3 months ago #123572

Hi

/home/.../public_html/.../templates/.../html/

means that you are using a view override.
The problem is now in your override, the original file should be fine, I suppose, because we don't have it in our local websites or in the demo website.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
11 years 3 months ago #123578

OK. So I'm starting from the beginning. I copied over the "unrevised" code to my template. The below is now what is in my template.

<?php
echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width, $height);
if(!empty($this->element->badges))
$this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0');
?>


My question now is, how do I get the badge to show on the listings page. It is showing on the details page, which is find, but I would also like ti to show on the listings page. It was doing this before I made the upgrade.

Thank you!!

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

Time to create page: 0.120 seconds
Powered by Kunena Forum