getLayout

  • Posts: 138
  • Thank you received: 4
7 years 9 months ago #275477

-- HikaShop version -- : 2.6

hi,
I wrrite some code plugin.I have a problem!!!

if($view->getName() == 'product') {

			if($view->getLayout() == 'show_quantity') {
when change SHOW_QUANTITY to SHOW_TABULAR , dont work. why?
getLayout in hikashop which value?


Joomla Developer | am.ebrahimzadeh[at]gmail.com

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

  • Posts: 83780
  • Thank you received: 13570
  • MODERATOR
7 years 9 months ago #275480

Hi,

I suppose that you're using the onHikashopBeforeDisplayView(&$view) or onHikashopAfterDisplayView(&$view) triggers of HikaShop in your plugin.
These triggers are called once when a view is displaying. The sub layouts that are called by the main view file won't trigger these functions.
show_tabular and show_quantity are all sub view files called from the main view file "show". So if you want to do something on the product page, you should use the "show" string for your check of the layout.

The following user(s) said Thank You: aminweb

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

  • Posts: 138
  • Thank you received: 4
7 years 9 months ago #275524

Thanks nicolas,
i useonHikashopAfterDisplayView(&$view)

function onHikashopAfterDisplayView($view) {

		$cheak = JFactory::getApplication()->input;

		if ($cheak->get('option') == 'com_hikashop' AND $cheak->get('ctrl') == 'product' AND $cheak->get('task') == 'show') {
if($view->getName() == 'product') {

			if($view->getLayout() == 'show_quantity') {

now, which string use instead of show_quantity?


Joomla Developer | am.ebrahimzadeh[at]gmail.com
Last edit: 7 years 9 months ago by aminweb.

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

  • Posts: 83780
  • Thank you received: 13570
  • MODERATOR
7 years 9 months ago #275530

Hi,

As I said, I think that you want to use "show" instead.

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

  • Posts: 138
  • Thank you received: 4
7 years 9 months ago #275573

but,when replace "show" instead of " show_quantity" , dont work...


Joomla Developer | am.ebrahimzadeh[at]gmail.com

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
7 years 9 months ago #275574

Hello,

What is not working ?
Please be more precise if you want the support team to understand what you're doing and what is your problem.

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: 138
  • Thank you received: 4
7 years 7 months ago #279574

I programming plugin for show field value by chart.
now I want show chart in bottom of product page.(bottom of description tab box)
now, what I do?
my function code :

function onHikashopAfterDisplayView($view) {

		$cheak = JFactory::getApplication()->input;

		if ($cheak->get('option') == 'com_hikashop' AND $cheak->get('ctrl') == 'product' AND $cheak->get('task') == 'show') {
if($view->getName() == 'product') {

			if($view->getLayout() == 'show_quantity') {
please help me.thnks


Joomla Developer | am.ebrahimzadeh[at]gmail.com

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

  • Posts: 12953
  • Thank you received: 1778
7 years 7 months ago #279580

Hello,

If you only want to do some view's modifications the solution will probably just be to directly edit the "show_quantity" or "show_default" file of the "product" view of your front-end template via "Hikashop->Display->Views".

www.hikashop.com/support/documentation/1...-display.html#layout

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

  • Posts: 138
  • Thank you received: 4
7 years 7 months ago #279636

This was not the answer to my question!


Joomla Developer | am.ebrahimzadeh[at]gmail.com

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
7 years 7 months ago #279641

Hello,

Unfortunately, we are not able to give you any help since you do not follow our first indications.
Nicolas told you to use the "show" layout since it will be that specific layout you need to check and then interact with the page content.

So I'm afraid we can't tell you what to do next if you do not start to follow what to do now.

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.

Time to create page: 0.076 seconds
Powered by Kunena Forum