Product display page

  • Posts: 23
  • Thank you received: 0
11 years 3 months ago #158774

As you can see on the screen shot i have i table of products. I would like to add another column to display a weekly price and also change the price to say daily rate.

How do i go about that please???

I would also like the description to be visible on this page too

Attachments:
Last edit: 11 years 3 months ago by Blatherwick. Reason: forgotten information

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 months ago #158776

Hi,
The solution will probably be to directly edit the code of the "listing_table" file of the "product" view of your front-end template via "Hikashop->Display->Views".

The following user(s) said Thank You: Blatherwick

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

  • Posts: 23
  • Thank you received: 0
11 years 3 months ago #158889

Thanks I will look into that this morning

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

  • Posts: 23
  • Thank you received: 0
11 years 3 months ago #158928

I have made a little progress but hit another wall.

As you can see in the screenshot the left part of the image is the product list page. I have looked in the php file suggested in the previous post which has enabled me to change the price heading but if i have to add php into the file so i can produce another column that displays the weekly rate too then im stuck as i do not know php well enough.

My second issue is with the right hand side of the image, How do i change the per day for the £180 to per week but keep per day for the £90?

PLease help as im nearly complete on this project!

Attachments:

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

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

Hi,

To add a column it require only html, and to display the quantity value, you can use code like

<?php echo $row->product_quantity; ?>

The second issue will require PHP custom code in order to display one sentence or another based on the price.
The view to edit will be "product / listing_price".

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

  • Posts: 23
  • Thank you received: 0
11 years 3 months ago #159230

Html? What code and where please?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 months ago #159243

Checking that thread will probably help you : www.hikashop.com/forum/4-how-to/84404-si...ing-page.html#112700

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161131

thanks, i will have a read

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161139

ok, i have adding in the column and the title.

How do i get the second price column to display the other price i have added in the product price section when adding a new product. The one with id 2 according to the back end hikashop product adding section.

Does that make sense?

EDIT

I have added the following code to product_listing_table.php
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){ ?>
<td class="hikashop_product_price_row">
<?php
$this->setLayout('listing_price');
echo $this->loadTemplate();
?>
</td>
<?php } ?>

How do i edit the code so it wont repeat the price_0 and it actually uses the price_1 added via the "add product" hikashop option

Last edit: 11 years 2 months ago by Blatherwick.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 2 months ago #161152

Hello,

How do i get the second price column to display the other price i have added in the product price section when adding a new product. The one with id 2 according to the back end hikashop product adding section.

Can you tell me what do you exactly mean by " the other price i have added" ? Is it a product custom field ?
Also can you show me what are you currently having for the moment, and what do you exactly want to have through some screenshots ?
Thanks.

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161203

yes sorry that was a half asked question.

I would like to use a different price for the price per week column. In the backend.jpg you can see that i have added two prices to the product. When you click on the product both prices are displayed but i would like the price per week column to also display the second price that i have added, the £180 price

Attachments:

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 2 months ago #161250

Hi,

I'm sorry to jump in the thread but I don't think that you're going in the right direction at the moment with this.
The way you configured your two prices, your customers won't be able to choose between one or the other on the product page (which I guess is something you want right ? Otherwise, I don't see the point in displaying two different prices).
And if you configure your products so that the customer can choose between the price per day and the price per column when adding the product to the cart, the code will have to be different on the listing to get the prices to display.

So before continuing the discussion on how to display the prices on the listing, I would ask you to first explain why you're trying to do that ? What kind of products are you selling ? Are you actually selling them or just displaying them ? etc.
We need a clear picture of what you want to do to be able to tell you what should be done.

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161266

Thanks for the reply.

All I want to do is display the products with the information. I have turned the shopping cart option off so it only displays as a catalogue because nothing will be purchased online.

The reason I have used hikashop is because the client needs to be able to update the products being displayed and I thought the most straight forward way to do this would be with a eccomerce plug in.

The .jpg shown is almost perfectly how I want it except for the incorrect price being displayed. I thought it might be as straight forward as changing where the php code was asking to retrieve the information from but could not see where to edit the code and what to edit it to.

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 2 months ago #161340

Hi,

That's great then. My concerns were unfounded :)

So first you need to change the "Price display method" option to "all" for your menu via the menu Display>Content menus.
That way the system will load both prices.
Then, you'll have to remove the code:

$this->setLayout('listing_price');
echo $this->loadTemplate();
which would actually display both prices one below the other, and add instead such code:
echo $this->currencyHelper->format(@$this->row->prices[0]->price_value,4);
echo '</td><td>';
echo $this->currencyHelper->format(@$this->row->prices[1]->price_value,4);

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161419

THanks.

I have edited the code as you have said above, i had two new columns appear. One with the price per day again and the the second price was zero.

I have deleted the original php to remove the original price per day which has left two columns but the Price per week column is zero even though i do have a second price entered for each price as shown in the previous backend.jpg

Attachments:
Last edit: 11 years 2 months ago by Blatherwick.

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

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

Hi,

Thanks to use the PHP code

var_dump($this->row->prices);
in order to see if there is many prices for your product.

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161541

In the listing_table file?

Would this replace anything or should it just be added to the php written by Nicolas in the previous post?

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

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

This is just temporary code in order to see the content of the PHP object $this->row->prices.
You can add it just after the code given by Nicolas.

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

  • Posts: 23
  • Thank you received: 0
11 years 2 months ago #161642

ok i see.

The problem i am having though in the product list view the price column is showing zero however when i click on the product and it opens up in a new page it shows both the prices that i have entered for the product.

I would like to see both of those prices on the product list page

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

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

Hi,

Thanks to use this code instead of the one given by Nicolas:

$prodClass = hikashop_get('class.product');
$prodClass->getProducts($this->row->product_id);
echo $this->currencyHelper->format(@$prodClass->products[1]->prices[0]->price_value,4);
echo '</td><td>';
echo $this->currencyHelper->format(@$prodClass->products[1]->prices[1]->price_value,4);

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

Time to create page: 0.114 seconds
Powered by Kunena Forum