Warning: Creating default object from empty value in

  • Posts: 27
  • Thank you received: 0
6 years 7 months ago #278446

-- HikaShop version -- : 3.2.0
-- Joomla version -- : latest
-- PHP version -- : 5.6
-- Error-message(debug-mod must be tuned on) -- : Warning: Creating default object from empty value in /usr/www/users/mvsphcqpma/components/com_hikashop/views/product/tmpl/cart.php on line 449

Good Afternoon

1. I get the following error message when adding a product to my cart:

Warning: Creating default object from empty value in /usr/www/users/..../components/com_hikashop/views/product/tmpl/cart.php on line 449



2. I also would like to know how can Remove the optional products from the cart when they are selected as none ?



3.Where can i add the following coding to the add to cart button ( data-uk-modal="{target:'#my-cart-modal'}" ) . So that my custom designed cart popup can be displayed ?


Regards

Attachments:

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 7 months ago #278451

Hello,

1 - Would it be possible to know the content of the line 449 ?
The problem is, if I look that file from the latest package, the line 449 contains

			continue;

2 - Yes it display the "none" because you have a variant which is added into the cart with that name.
You should apply a modification in the view to display a "none" in the list which won't add any product.
www.hikashop.com/forum/product-category-...t-option.html#138030

3 - You do not want to override the add to cart buttons to add such code ; because it will generate an unwanted side effect and the buttons won't add any products into cart, they will just open the popup.. And that's not what you want.
I because I don't know what you want to do exactly, I can't give you any hint for the moment.

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: 27
  • Thank you received: 0
6 years 7 months ago #278662

I have added the code you suggested on the link - www.hikashop.com/forum/product-category-...t-option.html#138030

but now when i add a product to the cart, it doesnt display in the cart.

Regards

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

  • Posts: 81540
  • Thank you received: 13070
  • MODERATOR
6 years 7 months ago #278663

Hi,

What that line will do is add a "no" choice in the dropdown of the option on the product page. So then, you can remove the variant of your option which does the "no" choice and when you select "no" in the option dropdown, it won't add the option at all to the cart and these lines won't appear on the cart.

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

  • Posts: 27
  • Thank you received: 0
6 years 7 months ago #278716

I understand that if a option is no or none it is not suppose to add to the cart, but when some one have selected an option the option doesnt add to the cart.

Please see screen recording on the video bellow:

drive.google.com/open?id=0BxT76p8aJy68YzcwUTBRTkxqNkE

Regards

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

  • Posts: 81540
  • Thank you received: 13070
  • MODERATOR
6 years 7 months ago #278720

Hi,

I think that there is a misunderstanding here.
If the customer selects "none" in an option, the option itself won't appear on the checkout, online the selected options will appear:
monosnap.com/file/qzz8NLOl7ij23TJ3SKy5wpXXJuGO67
However, there is no system to force the customer to select something in each of the options dropdown.
In that case, you should remove the "none" choice so that there is by default a choice for each dropdown and that the customer cannot see any "none" choice in the dropdowns.
You can do that by removing the line:
$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));
That you have added previously to the product / option.php view file.

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

  • Posts: 27
  • Thank you received: 0
6 years 7 months ago #278765

Yes there is a massive misunderstanding.

I have removed the none option:



Then i rename "no" in the language file with "none".

No my problem is that when i add a product with an option it doesnt display in the cart module. like in my screenshot video.

Regards

Attachments:

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

  • Posts: 81540
  • Thank you received: 13070
  • MODERATOR
6 years 7 months ago #278777

Hi,

Isn't that what you wanted ?
I'm sorry but if that's not it, then we didn't understand what you wanted. Could you please clarify what you want ?

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

  • Posts: 27
  • Thank you received: 0
6 years 7 months ago #278891

ok let me start from the top.

I have create a Characteristics called "none" gave it a zero price and made the default option.

But my problem is that when you sellect another option , you get the none Characteristics added to the cart, i dont mind it bit doesnt look very neet.

You guys got back to me if the code modification that will no to the product options. I have then renamed no to none in the langauge file.

When you click add to cart, nothing displays in the cart module.

If this doesnt make sende , we need to setup a skype support call.

Please create a profile on my site and try to buy a photo with options. then go the checkout eft. you will see my problems,

mvsphotography.co.za/buy-online-only/glow-worms-2017

Regards

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

  • Posts: 81540
  • Thank you received: 13070
  • MODERATOR
6 years 7 months ago #278962

Hi,

So you say that your issue was that you had "none" option lines added to the cart along with the selected options of the product.
And we provided a fix to avoid that.
And now you don't have that.

However, in the cart module you don't have anything being displayed now.

To me both of these matters are not linked together. The cart module not displaying has nothing to do with the "none" options being visible or not in the cart. It looks like a separate matter. And I can't even say why you have a popup opening when you click on the "my cart" button or where that "my cart" button comes from as there is no such thing by default in HikaShop.
So we would actually need more details on how you configured that "my cart" button and that popup. And also, if you switch to the default template of Joomla, do you have the same issue ?

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

Time to create page: 0.113 seconds
Powered by Kunena Forum