Lost customizations with large Update

  • Posts: 7
  • Thank you received: 0
  • Hikashop Business
6 years 9 months ago #288420

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 5.6.33
-- Browser(s) name and version -- : Chrome 64.0.3282.167

Our webstore was developed with HikaShop [1409241754] several years ago. It had to be customized at that time to meet our requirements. I am trying to upgrade the website to current, and I have lost functionality. I can provide the url for the test environment via PM if needed.

  • ]All of the "Additional information" that can be found in the checkout process (on our current site) has disappeared (on the test site).
  • I have discovered that there is a purchase order plugin now, and I have added that in. This would remove the Purchase Order Number field in the Additional information area, but I still need the upload option.
  • "Add to cart" functionality has been lost. Previewing the cart and updating the number when items are added to cart.
  • Turning off Legacy Add to Cart did now allow the cart count to increment. However, I was able to get the count number to increment by leaving Legacy Add to Cart "On" and disabling the "Use AJAX" for add to cart
  • [/ul
    Rambling aside, I would like to use as much default logic as possible, to prevent these issues in the future. I assume it would be best to be able to have all legacy stuff set to "off".
    What I really must have:
  1. Incremented cart counter when add to cart is clicked, not a user forced page reload
  2. File upload for Purchase Orders in the checkout process
  3. Some custom text fields for extra shipping information int he checkout process

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 9 months ago #288452

Hi,

1. The additional information is displayed by the custom field system. Edit your custom order fields via the menu Display>Custom fields and make sure that the new display settings of your custom fields (these settings were added in HikaShop 3.0.0) are configured like you want (checkout display setting activated).

2. Turn off the "add to cart legacy" setting in order to use the new add to cart system. If the cart module is not being refreshed after that. Then either you're not using the default cart module of HikaShop, or you want to rename the file templates/YOUR_TEMPLATE/html/com_hikashop/product/cart.php in order to deactivate the customization made to the cart module.

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

  • Posts: 7
  • Thank you received: 0
  • Hikashop Business
6 years 9 months ago #288527

nicolas wrote: Hi,
1. The additional information is displayed by the custom field system. Edit your custom order fields via the menu Display>Custom fields and make sure that the new display settings of your custom fields (these settings were added in HikaShop 3.0.0) are configured like you want (checkout display setting activated).

2. Turn off the "add to cart legacy" setting in order to use the new add to cart system. If the cart module is not being refreshed after that. Then either you're not using the default cart module of HikaShop, or you want to rename the file templates/YOUR_TEMPLATE/html/com_hikashop/product/cart.php in order to deactivate the customization made to the cart module.


Per comment 1: This resolved the issue. I had to go in each variable and switch "Order additional information" to Yes.
Per Comment 2: I turned off "add to cart legacy" setting, and the cart module was not being refreshed. I do not know if we are using the default cart module, so I renamed the cart.php to cart_old.php. The cart module is still not refreshing, I do not see a new cart.php created and now when I click on the cart, it looks...broken, see screenshot.

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 9 months ago #288530

Hi,

2. You're still using the legacy add to cart buttons as far as I can see.
So if you still have that option turned off, it means that either you have some caching on your pages, or you have some view overrides in templates/YOUR_TEMPLATE/html/com_hikashop/product/ with old code. You'll have to rename the files one by one until you identify the one which prevents the new add to cart buttons for displaying.
Regarding the cart module, on your screenshot, it looks like a CSS issue. We would need a link to the test website where you have the issue so that we could have a look at the situation to tell you why the CSS is messed up. It's probably linked to some CSS in your template.

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

  • Posts: 7
  • Thank you received: 0
  • Hikashop Business
6 years 9 months ago #288639

Nicolas,
I have messaged you the url and credentials to get in, as I have the test site password protected.
There are two files in that directory: cart.php and show_tabular.php. I have added _old to both. From within Joomla a "Clean Cache" was performed. and from within the browser, I have cleared all cookies/history. The "Add to Cart" button still does not increment.
Edit: It might be worth noting that I am using Mozilla Firefox 58.0.2 (64-bit) for viewing the website, and Chrome for modifying (for ease of clearing browser cookies)

Last edit: 6 years 9 months ago by macit. Reason: Browser usage update

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 9 months ago #288643

Hi,

There is an issue with what is returned by the server when the AJAX call is sent by HikaShop to the server:
monosnap.com/file/kGG6cEu4b3peKxcsrzs0UaNFfExd3n
Your template is adding javascript to the returned data when it shouldn't
Because of that it messes with the new add to cart system.
I'm afraid you'll have to contact your template provider and check with them because we don't know how they do that or how they customized everything so we can say what should be done.

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

  • Posts: 7
  • Thank you received: 0
  • Hikashop Business
6 years 9 months ago #288714

Nicolas,
Thank you for the information.
One last thing related to the Additional Information. How do I add the Purchase Order Number from the HikaShop Purchase Order Payment Method to the Order Notification Email? Originally, the Purchase Order Number was an additional information field, and it was added to print in the email. I would like to maintain that, even though I want to switch payment method to use the HikaShop Purchase Order. I am having a hard time figuring out how to add this new variable to the email.
Components > HikaShop > System > Emails > Order Notification
There are three "versions": HTML, Text and Preload. Inside the HTML I found:
<!--{IF:ORDER_SUMMARY}-->
<h1 style="color:#1c8faf !important;font-size:16px;font-weight:bold;border-bottom:1px solid #ddd;padding-top:10px;padding-bottom:10px;">
{TXT:ADDITIONAL_INFORMATION}
</h1>
Which seems promising, but I don't know where or how to modify the ADDITIONAL_INFORMATION or if that is really the correct thing to modify, since the new variable is part of the Purchase Order Payment Method.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 8 months ago #288724

Hi,

Add the code:

	public function onAfterOrderProductsListingDisplay(&$order, $type) {
		if(empty($order->order_id)) return;
		$database = JFactory::getDBO();
		$query='SELECT history_data FROM '.hikashop_table('history').' WHERE history_order_id='.(int)$order->order_id.' AND history_data != \'\' ORDER BY history_created ASC';
		$database->setQuery($query);
		echo $database->loadResult();
	}
in the file plugins/hikashoppayment/purchaseorder/purchaseorder.php
That will add the text from the history data that you can see in the backend to the email notifications.
Let us know how it goes so that we can include that for the next version of HikaShop.

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

  • Posts: 7
  • Thank you received: 0
  • Hikashop Business
6 years 8 months ago #288818

Nocolas,
-That code worked, but I would need a new line before it. It has smashed onto the end of the other Additional Information output (see picture).
-I found something else missing from this upgrade, we had some of the Additional Information fields hidden or shown based on certain information. In this case, it was based on shipping choice.
Concept was, shipping option Ground vs Freight was determined by weight of the cart. This part works as intended on the Shipping Options side. However, on top of that, certain fields were hidden when Ground shipping was selected. Certain other fields were hidden when Freight shipping option was selected.

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 8 months ago #288821

Hello,

1 - So you should echo a "<br/>".

2 - I think that we would need more details to understand what you're talking about exactly.
Because, for what I can currently understand, you're talking about displaying or hiding custom fields depending the shipping method.

Now, if I understand it right ; you're talking about a feature which was never in HikaShop. Technically, there is nothing "missing from the upgrade".
Nevertheless, it can be something you previously modified in HikaShop (without using the override system but modifying directly core files) and which has been reset with the installation of the update. It is highly possible that some kind of code has been provided via the forum ; it is mainly some PHP code to display or not some "text" depending the method you can read in the order object.

Generally speaking, I would recommend you to get a backup of your website before the update in order to extract your customization.
And best would be to re-implement these customization using the override system of HikaShop so you would be sure to not look them with updates.

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: 7
  • Thank you received: 0
  • Hikashop Business
6 years 8 months ago #288855

1 - This worked.

public function onAfterOrderProductsListingDisplay(&$order, $type) {
		if(empty($order->order_id)) return;
		$database = JFactory::getDBO();
		$query='SELECT history_data FROM '.hikashop_table('history').' WHERE history_order_id='.(int)$order->order_id.' AND history_data != \'\' ORDER BY history_created ASC';
		$database->setQuery($query);
                echo "<br/>";
		echo $database->loadResult();
	}
2 - Your understanding is correct. The custom fields were either displayed or hidden based on the Shipping Method selected (the shipping method was a forced selection based on cart weight).
I did not mean to imply this was a feature of HikaShop, just that our cart behaved this way before the update, and now it does not. I am attempting to pick up the pieces after a developer that gave no documentation. We no longer have a good relationship with this developer, so we cannot ask them for information.
The update is being tested in a test environment, so our current website is still up and running the old Joomla and HikaShop versions.
Re-implementing the functionality is fine, but my PHP skills are lacking. I am a programmer, but my knowledge in HTML and PHP is limited. Could you give me some direction in the override system for this task: Hide "Custom fields" based on what "Shipping method" is selected?
3 - As a side note, where can I modify the message the customer receives from an order?

You can now send us a purchase order for the amount of $x.xx using the following information. We will now process your order and contact you when completed.

This is not necessary, since we give them the ability to upload a Purchase Order during the checkout process.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 8 months ago #288861

Hi,

2. So if you had custom code to handle that it was probably javascript and I suppose it was meant for the checkout in HikaShop 2.x
Since HikaShop 3.x, you can still use that checkout with the "checkout legacy" setting activated, so I suppose that if you keep that option turned on, your custom code should still work.
But with the new checkout system, it will require a completely different javascript.
It actually doesn't require HTML or PHP changes.
What you need is to edit the file "show_block_fields" via the menu Display>Views. There you need to register your javascript code to be triggered when the shipping method is changed:

window.Oby.registerAjax(['checkout.shipping.updated'], function(params){
	// your js code to hide/display custom fields
});
stackoverflow.com/questions/6242976/java...pt-hide-show-element

3. You can use a translation override:
www.hikashop.com/download/languages.html#modify

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

  • Posts: 12
  • Thank you received: 2
6 years 8 months ago #288957

Hey there,

i don’t know if i’m right here but i’ve a question in this direction.
is it possible to style the colour of a part of payment-information?
In my case i want to highlight the parameters which let me find the correct
order to the purchase via bank-account.
maybe you understand my question better when you look on my screenshot.
I want to have only the highlighted part in a red colour for example.
Better both – in email and on the confirm-site after checkout.
Where can i find the code to customize it?

Thanks a lot for your help and sorry for my bad english…

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 8 months ago #288963

Hello,

I'm sorry but I don't see the link between your question and the thread subject.
Please open a new thread.

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: 7
  • Thank you received: 0
  • Hikashop Business
6 years 8 months ago #289081

Nicolas,
Sorry for the delay, I thought I responded last Friday.
2) I am having trouble getting this to work. Tried following the example in the link you provided and failed. Also tried a couple other examples I saw online, but none of them seemed to hide the fields. Tried to use an if statement to validate the shipping option selected, but eventually put some of the hide statements before to see whether the if statement was wrong. Here is some of the stuff I tried:

<script type="text/javascript">
window.Oby.registerAjax(['checkout.shipping.updated'], function(params){
  $(".hkcontrol-group control-group hikashop_checkout_collect_freight_phone_line").hide();
  $(".hkc-sm-8").hide();
  document.collect_feight_phone.style.display = 'none';
  if ($('#shipping_radio_1_2__0__manual_1').is(':checked')){
    $(".hkc-sm-8").hide();
  }else{
    $(".hkc-sm-8").show();
  };
	if(hikashop_checkout_shipping_radio="1"){
      $("#collect_freight_phone").hide();
      document.collect_feight_phone.style.display = 'none';
    };
    if(value="6"){
      document.order_freightco.style.display = 'none';
      document.order_shippingaccount.style.display = 'none';
    };
});
</script>

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

  • Posts: 12
  • Thank you received: 2
6 years 8 months ago #289083

sorry for that – i’ve opened an other topic for this question…

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

Time to create page: 0.090 seconds
Powered by Kunena Forum