show_tabular.php

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
5 years 4 months ago #308900

-- HikaShop version -- : 4.1.0
-- Joomla version -- : 3.9.5
-- PHP version -- : 7

Hi,
I want to add code to the product page written in php, which will extract information from the database by product code and display it on the screen. Which file do I need to make changes so that when Hikashop updating my changes are not deleted and at the same time Hikashop doesn’t break? Can I do this directly in show_tabular.php?

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
5 years 4 months ago #308902

Hi,

If you do your change via the Display>Views menu, as we recommend on the tutorial below, you won't loose your changes when you update:
www.hikashop.com/support/documentation/1...-display.html#layout

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
4 years 9 months ago #315134

Hi

I checked php error log today and found a lot of warnigns like this

WARNING: [pool www] child (NNNNN) said into stderr: "NOTICE: PHP message: PHP Notice: Undefined index: cid in /.../html/com_hikashop/product/show_tabular.php on line 315"

the 315 line is

var data = "product_id=<?php echo $_REQUEST['cid']; ?>&characteristic_id="+this.value;

from this script
<script type="text/javascript">
jQuery(document).ready(function(){
if(jQuery('.hikashop_product_characteristics_table select').length == 2){
jQuery('.hikashop_product_characteristics_table select:first').on('change',function(){
var data = "product_id=<?php echo $_REQUEST['cid']; ?>&characteristic_id="+this.value;
jQuery.ajax({
type: "POST",
url: "index.php?option=com_ajax&plugin=wwmhikavariantfix&format=raw",
data: data,
success: function(data){
if(data !== 0){
jQuery('.hikashop_product_characteristics_table select:last').html(data);
jQuery('.hikashop_product_characteristics_table select:last').trigger('change');
}
}
});
});
}
})
</script>

How to fix ?

Last edit: 4 years 9 months ago by Bender.

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

  • Posts: 82823
  • Thank you received: 13370
  • MODERATOR
4 years 9 months ago #315151

Hi,

There is no such line in show_tabular.php nor such block of code.
Also, the file path indicates that you're looking at a view override of show_tabular.php
So I suppose that this is some code that you added yourself.
Now, as a simple fix, you can change the line:

var data = "product_id=<?php echo $_REQUEST['cid']; ?>&characteristic_id="+this.value;
to:
var data = "product_id=<?php echo @$_REQUEST['cid']; ?>&characteristic_id="+this.value;
it should remove the notice message.

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

  • Posts: 215
  • Thank you received: 6
  • Hikashop Business
4 years 9 months ago #315173

Excuse me please Nicolas.
It is indeed not a Hikashop script.
Thanks a lot.

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

Time to create page: 0.052 seconds
Powered by Kunena Forum