[SOLVED]Product page-no price

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #133782

Hello again :).

Can i display product page with no prize? I tried with Associated products listing for category listing menu XXX,
but if i display all product i can choose Display prize-NO. And this work. But if i enter product X i see prize.

I want this option to browse products without going to the store

Last edit: 11 years 7 months ago by Soko?owski.

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

  • Posts: 84079
  • Thank you received: 13636
  • MODERATOR
11 years 7 months ago #133877

Hi,

For the product page, go in the Display tab of the configuration and turn off the "show price" option there and it will apply for the product page.

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #133884

Thx.
But i dont want no prize for global setting but for specific page.

Last edit: 11 years 7 months ago by Soko?owski.

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

  • Posts: 84079
  • Thank you received: 13636
  • MODERATOR
11 years 7 months ago #133898

Then you need to say it when you ask :)

Instead of doing that, keep the show price option turned on and just change the "free" text with a translation override:
www.hikashop.com/download/languages.html#modify

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #134001

Thanks,

But in my case, the situation is more complicated.

For every product I have set two prices. For registered users and public users. In addition,I wants to add a page with the same products as the shop where I could display the products without a price. So I cant add "free" for public users.

Maybe, that I understood you wrong?

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

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

Hi,

For every product I have set two prices. For registered users and public users. In addition,I wants to add a page with the same products as the shop where I could display the products without a price. So I cant add "free" for public users.

If you don't want the "free" text to be displayed you'll just have to edit your translation file through "Hikashop->System->Configuration->Language->YourTranslationFile", and change this line :
FREE_PRICE="Free"
By :
FREE_PRICE=" "

Note that if your situation is more complicated than that, you'll have to give us more information.

Last edit: 11 years 7 months ago by Mohamed Thelji.

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #134020

I still dont know how well introduce my problem. So I will use an example:

Menu: Home, About us, Product, Shop
Users: Register(lower prices), Public(higher prices).
Example product: "X"

If public user go to the "shop" menu and go to X product page, X cost 100$.
If register user go to the "shop" menu and go to the X product page, X cost 50$
(This work!) And my case:

If public/register user go to the "product" menu he should see exactly the same product as in the "shop" menu. So if public/register user go to the "product" meny and go to the X product page, X cost nothing(i know how set tranlation from free to nothing) and he cant add X to the bascet.

So "product" menu is only preview page for all products. I know how set no price for all product from specyfic category(Associated products listing for category listing menu). But if public/register user enter X product page in "product" menu he see still price.

I cant add new access in hikashop with free price, becouse public/register users must see diffrent prices in "shop" menu.

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

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

Hi,

So to be sure:
- Product menu > Display products without prices and without add to cart button
- Shop menu > Display products with prices (one for public, one different and lower for registered) and add to cart button

Actually, the shop menu is fine with the two different prices, etc.

What you want is hide the price and the add to cart button when reaching the products from the product menu, right ?

If it is, it will require some custom code to check from which menu we come and display or not the price and the button.
You will have to edit the view "product / show_default" and add a code like:

global $Itemid;
if(isset($Itemid) && $Itemid != 'xx'){
    ...
}
where "xx" is the desired menu id.

Place this if condition around the quantity and listing_price parts. You can find them thanks to the comments in the view.

The following user(s) said Thank You: Soko?owski

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #134128

Hi,

Great solution! :woohoo:


I have modified some code that you entered me. I'm not fluent in PHP(beginner), so if you think you can do it better let me know.

1. First i modified: <span id="hikashop_product_price_main" class="hikashop_product_price_main"></span>

<?php

global $Itemid;
if(isset($Itemid) && $Itemid == '234'){
    echo 'W celu dokonania zakupów zapraszamy do zakładki sklep<br/><br/>';
}
    else {
$this->row = & $this->element;
      $this->setLayout('listing_price');
      echo $this->loadTemplate();
}
    
    ?>
"W celu dokonania zakupów zapraszamy do zakładki sklep" means "if u want buy product go to the shop menu."

2. <div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"></div>
 <?php
      global $Itemid;
if(isset($Itemid) && $Itemid == '234'){
    echo '<br/><br/>';
}
      else {
      $this->row = & $this->element;
      $this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
      $this->setLayout('quantity');
      echo $this->loadTemplate();}
      ?>

And this work! But if i change color of product(diffrent characteristic) then price appear. I am not sure where and how change code, but I was looking for "product / show_block_characteristic.php" close this code:
$main_prices = '';
if(!empty($this->element->main->prices)){
        foreach($this->element->main->prices as $price){
          $main_prices.='|'.$price->price_value.'_'.$price->price_currency_id;
        }

Could I get a little help? :cheer: :)

Last edit: 11 years 7 months ago by Soko?owski.

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

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

Hi,

You can potentially hide the characteristic display by adding the previous if condition around the code:

	if(empty ($this->element->characteristics) || $this->params->get('characteristic_display')!='list'){ ?>
		<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
			<?php
			//LAYOUT quantity
			$this->row = & $this->element;
			$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
			$this->setLayout('quantity');
			echo $this->loadTemplate();
			?>
		</div>
	<?php }

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #134266

But i dont want hide characteristic. I just want to do the same on characteristic page(in product menu). Remover cart and prices.

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

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

Hi,

Sorry for the late reply.
You have to put the if condition around:

<span id="hikashop_product_price_main" class="hikashop_product_price_main">
...
</span>

And:

<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
...
</div>

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #134950

I think it isnt enough. I modyfied this lines(I wrote this in post above).

But I tested if I did it well. For example from:

<?php

global $Itemid;
if(isset($Itemid) && $Itemid == '234'){
    echo 'W celu dokonania zakupów zapraszamy do zakładki sklep<br/><br/>';
}
    else {
$this->row = & $this->element;
      $this->setLayout('listing_price');
      echo $this->loadTemplate();
}
    
    ?>

I deleted:
$this->row = & $this->element;
      $this->setLayout('listing_price');
      echo $this->loadTemplate();

and still if i change on characteristic i see prices. But on main product page I dont see prices(for all itemid!)

So my conclusion: Prices for characteristic are dynamically set in another place.

Last edit: 11 years 7 months ago by Soko?owski.

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

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

Hi,

Yes you're right they are set dynamically in another place, and it replca the content in the <div< and in the <span>.

So that's why you have to put in the if condition the "div" and "span" tags.
Contrary to the previous code which include only the content of these div/span, and not the div/span tag.

The following user(s) said Thank You: Soko?owski

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

  • Posts: 35
  • Thank you received: 0
11 years 7 months ago #135012

Thx!
Now it works! My code:

<?php   global $Itemid;
if(isset($Itemid) && $Itemid == '234'){ ?>
 
     <?php } else { ?>
  <span id="hikashop_product_price_main" class="hikashop_product_price_main">
    <?php

$this->row = & $this->element;
      $this->setLayout('listing_price');
      echo $this->loadTemplate(); ?>

<?php } ?>
   
 
  </span>

and
  <?php   global $Itemid;
if(isset($Itemid) && $Itemid == '234'){ ?>
    <?php } else { ?>
  
    <div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
      <?php
   
      $this->row = & $this->element;
      $this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
      $this->setLayout('quantity');
      echo $this->loadTemplate();}
      ?>
    </div>

  <?php } ?>

Problem solved!

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

Time to create page: 0.100 seconds
Powered by Kunena Forum