Other info in Order detail

  • Posts: 107
  • Thank you received: 1
11 years 11 months ago #82952

Hi there,

In the order detail page of a certian order, there is a section called "Other info" (Translated from tranditional chinese).

I found the in the dropdown select list of shipping and payment method, there are options which have been disabled.

Such as:





I realized these options just appeared after I clicked into the corresponding shipping and payment methods.

However, I didn't enabled them.






I wonder why they still appear in the shipping and payment method value of the order detail page?

Is it a bug or I just missed anything?

The relative code is:
<tr>
						<td class="key">
							<?php echo JText::_( 'SHIPPING' ); ?>
						</td>
						<td>
							<?php
								echo $this->currencyHelper->format($this->order->order_shipping_price,$this->order->order_currency_id);
								echo $this->popup->display(
									'<img style="vertical-align:middle;" alt="'.JText::_('HIKA_EDIT').'" src="'. HIKASHOP_IMAGES.'edit.png"/>',
									'HIKA_EDIT',
									hikashop_completeLink('order&task=changeplugin&plugin='.$this->order->order_shipping_method.'_'.$this->order->order_shipping_id.'&type=shipping&order_id='.$this->order->order_id,true),
									'hikashop_edit_shipping',
									760, 480, '', '', 'link'
								);
								if(!empty($this->shipping)){
									$this->shipping->order = $this->order;
									echo $this->shipping->display('data[order][shipping]',$this->order->order_shipping_method,$this->order->order_shipping_id);
								}?>
						</td>
					</tr>
					<tr>
						<td class="key">
							<?php echo JText::_( 'HIKASHOP_PAYMENT' ); ?>
						</td>
						<td>
							<?php
								echo $this->currencyHelper->format($this->order->order_payment_price,$this->order->order_currency_id);
								echo $this->popup->display(
									'<img style="vertical-align:middle;" alt="'.JText::_('HIKA_EDIT').'" src="'. HIKASHOP_IMAGES.'edit.png"/>',
									'HIKA_EDIT',
									hikashop_completeLink('order&task=changeplugin&plugin='.$this->order->order_payment_method.'_'.$this->order->order_payment_id.'&type=payment&order_id='.$this->order->order_id,true),
									'hikashop_edit_payment',
									760, 480, '', '', 'link'
								);
								if(!empty($this->payment)){
									$this->payment->order = $this->order;
									echo $this->payment->display('data[order][payment]',$this->order->order_payment_method,$this->order->order_payment_id);
								}?>
						</td>
					</tr>

Thank you so much for checking it. :)

Attachments:
Last edit: 11 years 11 months ago by tinachou.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
11 years 11 months ago #83005

Hi,

It's not a bug. It's to allow you to set payment methods to orders without the users being able to select them on the checkout. If you saved once a payment method options, the payment method will display there so that you can select it.

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

  • Posts: 107
  • Thank you received: 1
11 years 11 months ago #83063

Dear J.,

Thanks for the explanation. :)

However, for my case, I have uninstalled the HSBC and VirtualMerchant through "Extension Manager".

The respective options can still be selected?

Thank you for checking. :)

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

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

Hi,

The options are stocked in database, check in you phpMyAdmin interface if you have these payment methods in the table "#__hikashop_payment".
If they are present, try to remove them.

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

  • Posts: 107
  • Thank you received: 1
11 years 11 months ago #83177

Dear X.,

It seems the corresponding code is:

if(!empty($this->payment)){
$this->payment->order = $this->order;
echo $this->payment->display('data[order][payment]',$this->order->order_payment_method,$this->order->order_payment_id);

I wonder how to change it into "non-selectable" (fixed) option. So the payment or shipping methods can stay in their original values.

:)

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #83182

Hi,

You are near the solution but it's not the right file.
The third line call the "HikaShop Payment Type". You should look at this file into the folder "type" (in the administration part).
It is this file which display the HTML.

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: 107
  • Thank you received: 1
11 years 11 months ago #83499

Dear J.,

Do you mean in the Type->Payment?

	function load($form){
		$this->values = array();
		$pluginsClass = hikashop_get('class.plugins');
		$methods = $pluginsClass->getMethods('payment');

		if(!$form){
			$this->values[] = JHTML::_('select.option', '', JText::_('ALL_PAYMENT_METHODS') );
		}
                
		if(!empty($methods)){
			foreach($methods as $method){
				$this->values[] = JHTML::_('select.option', $method->payment_type, $method->payment_name );
			}
		}
	}

I wonder how can I adjust it and only display the "default" (user-specified) payment type? ( i.e., the selection or change of payment type if not allowed.)

Thank you so much. :)

Last edit: 11 years 11 months ago by Jerome.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #83536

Hi,

First edit the file "administrator/com_hikashop/views/order/view.html.php" and replace the content in the "form" function

		$pluginsPayment = hikashop_get('type.plugins');
		$pluginsPayment->type='payment';
		$this->assignRef('payment',$pluginsPayment);
By:
		$pluginsPayment = hikashop_get('type.payment');
		$this->assignRef('payment',$pluginsPayment);

After that, edit the file "administrator/com_hikashop/types/payment.php" and use this content:
<?php
class hikashopPaymentType{
	var $extra = '';
	function load($form, $value = ''){
		$this->values = array();
		$pluginsClass = hikashop_get('class.plugins');
		$methods = $pluginsClass->getMethods('payment');
		if(!$form){
			$this->values[] = JHTML::_('select.option', '', JText::_('ALL_PAYMENT_METHODS') );
		}
		if(!empty($methods)){
			foreach($methods as $method){
				if(!$method->enabled && $method->payment_type != $value) continue;
				$this->values[] = JHTML::_('select.option', $method->payment_type, $method->payment_name );
			}
		}
	}
	function display($map,$value,$form=true,$attribute='size="1"'){
		$this->load($form, $value);
		if(!$form){
			$attribute .= ' onchange="document.adminForm.submit();"';
		}
		return JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox" '.$this->extra.' '.$attribute, 'value', 'text', $value );
	}
}

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: 107
  • Thank you received: 1
11 years 10 months ago #85550

HI there,

I checked the #_hikashop_payment table in Database, and there are only 10 methods.




But in the back end, I see there are still 14 method, where the circled 4 methods were already removed before.




I hope to remove the 4 uninstalled methods in the payment method control panel of hikashop (otherwise, it will be inconsistent.). What should I do?

Thank you so much. :)

Attachments:
Last edit: 11 years 10 months ago by tinachou.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 10 months ago #85680

Hi,

HikaShop store a line in the database only when you edit a plugin configuration.

After that, I don't understand your message. Why you don't use the patch that I gave you two weeks ago ?

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: 107
  • Thank you received: 1
11 years 10 months ago #85729

Hi J.,

I have used your patch. It works. :) Thank you very much. :) :) :)

(I think the patch your provided is only for correcting the payment selecting list in Order detail.)


The problem now is that in the hikashop payment plugin panel, there are 4 uninstalled payment plugins. According to Xavier's previous reply, they may be stuck in the database so they are still existing in the panel... ( For general logic, the plugin shouldn't exist as an option in the payment plugin panel after it is uninstalled, right? )

However, when I go to the Table #_hikashop_payment,I cannot find them. My question is how to "NOT Display" those uninstalled plugins?

Last edit: 11 years 10 months ago by tinachou.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
11 years 10 months ago #85763

Hi,

The options of the plugin stays in the database even if you delete the plugin because then, when you reinstall the plugin, you get the options back. You wouldn't believe the number of people uninstalling something they should not have... then, if we remove the options on uninstall, they would have lost their settings and they are not always the ones configuring HikaShop in the first place...

A plugin which is both uninstall in Joomla and not in the payment table of HikaShop won't display since there is no data about it anymore anywhere. You must have missed something. Maybe you didn't delete the correct plugin ?

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

Time to create page: 0.089 seconds
Powered by Kunena Forum