[Skip to main content](#vessel-content)

#   php code to display price and image

##

- **[intown](/forum/user/26697-intown "View intown's Profile")**
- [![intown's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/cat.png)](/forum/user/26697-intown "View intown's Profile") Topic Author
- [ Offline](/forum/user/26697-intown)

Less More

- Posts: 70
- Thank you received: 4
-
-
-

12 years 5 months ago [\#157733](#157733) by [intown](/forum/user/26697-intown "View intown's Profile")  *[php code to display price and image](/forum/26-product-category-display/868560-php-code-to-display-price-and-image#157733 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.0  Hi I am working on integrating a custom script with hikashop.  I have been editing show&#95;tabular product view  To call the product name I am using this code:  How do I display The price without any formatting , just need the numbers The main product image starting with http://  I looked around and could not find what these code snippets should be.  Thanks! -- Steven")* was created by *[intown](/forum/user/26697-intown "View intown's Profile")*

-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3.0

Hi I am working on integrating a custom script with hikashop.

I have been editing show_tabular product view

To call the product name I am using this code: Code:

&lt;?php echo $this-&gt;element-&gt;main-&gt;product_name; ?&gt;

How do I display
The price without any formatting , just need the numbers
The main product image starting with http://

I looked around and could not find what these code snippets should be.

Thanks! -- Steven

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg1NjAtcGhwLWNvZGUtdG8tZGlzcGxheS1wcmljZS1hbmQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 5 months ago [\#157736](#157736) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[php code to display price and image](/forum/26-product-category-display/868560-php-code-to-display-price-and-image#157736 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.0  Hi I am working on integrating a custom script with hikashop.  I have been editing show&#95;tabular product view  To call the product name I am using this code:  How do I display The price without any formatting , just need the numbers The main product image starting with http://  I looked around and could not find what these code snippets should be.  Thanks! -- Steven")*

Hi,

For the price value: Code:

echo $this-&gt;element-&gt;prices[0]-&gt;price_value_with_tax; // OR echo $this-&gt;element-&gt;prices[0]-&gt;price_value;

For the image: Code:

$config = hikashop_config(); $image = reset($this-&gt;element-&gt;images); $path = JPATH_ROOT.DS.$config-&gt;get('uploadfolder').$image-&gt;file_path; echo $path;

The following user(s) said Thank You: [intown](/forum/user/26697-intown "View intown's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg1NjAtcGhwLWNvZGUtdG8tZGlzcGxheS1wcmljZS1hbmQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[intown](/forum/user/26697-intown "View intown's Profile")**
- [![intown's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/cat.png)](/forum/user/26697-intown "View intown's Profile") Topic Author
- [ Offline](/forum/user/26697-intown)

Less More

- Posts: 70
- Thank you received: 4
-
-
-

12 years 5 months ago [\#157896](#157896) by [intown](/forum/user/26697-intown "View intown's Profile")  Replied by *[intown](/forum/user/26697-intown "View intown's Profile")* on topic *[php code to display price and image](/forum/26-product-category-display/868560-php-code-to-display-price-and-image#157896 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.0  Hi I am working on integrating a custom script with hikashop.  I have been editing show&#95;tabular product view  To call the product name I am using this code:  How do I display The price without any formatting , just need the numbers The main product image starting with http://  I looked around and could not find what these code snippets should be.  Thanks! -- Steven")*

Thanks so much for the reply and info.

The code to call the price worked great

For the code to call the image.
the entire path is being called. /home/xxxx/media/..../filename.jpg
I want the output to look like
[ domain.com/media/....../filename.jpg](http://domain.com/media/....../filename.jpg)

What would I change the code to get the desired output?

Thanks! -- Steven

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg1NjAtcGhwLWNvZGUtdG8tZGlzcGxheS1wcmljZS1hbmQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[intown](/forum/user/26697-intown "View intown's Profile")**
- [![intown's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/cat.png)](/forum/user/26697-intown "View intown's Profile") Topic Author
- [ Offline](/forum/user/26697-intown)

Less More

- Posts: 70
- Thank you received: 4
-
-
-

12 years 5 months ago [\#157924](#157924) by [intown](/forum/user/26697-intown "View intown's Profile")  Replied by *[intown](/forum/user/26697-intown "View intown's Profile")* on topic *[php code to display price and image](/forum/26-product-category-display/868560-php-code-to-display-price-and-image#157924 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.0  Hi I am working on integrating a custom script with hikashop.  I have been editing show&#95;tabular product view  To call the product name I am using this code:  How do I display The price without any formatting , just need the numbers The main product image starting with http://  I looked around and could not find what these code snippets should be.  Thanks! -- Steven")*

Here is what I figured out, I also needed to add backslashes before every slash
Code:

$config = hikashop_config(); $image = reset($this-&gt;element-&gt;images); $path = JPATH_ROOT.DS.$config-&gt;get('uploadfolder').$image-&gt;file_path; $shortpath = substr($path, 47); $shortpathslashes = str_replace("/", "\\/", $shortpath); echo "path: " . $path . "&lt;br /&gt;"; echo "shortpath: " . $shortpath . "&lt;br /&gt;"; echo "shortpathslashes: http:\/\/www.lockharttactical.com" . $shortpathslashes;

Is there a better way to do this?

Thanks! -- Steven

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg1NjAtcGhwLWNvZGUtdG8tZGlzcGxheS1wcmljZS1hbmQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86357
- Thank you received: 14289
-
-

12 years 5 months ago [\#157964](#157964) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[php code to display price and image](/forum/26-product-category-display/868560-php-code-to-display-price-and-image#157964 "-- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.3.0  Hi I am working on integrating a custom script with hikashop.  I have been editing show&#95;tabular product view  To call the product name I am using this code:  How do I display The price without any formatting , just need the numbers The main product image starting with http://  I looked around and could not find what these code snippets should be.  Thanks! -- Steven")*

you could do like that: Code:

$config = hikashop_config(); $image = reset($this-&gt;element-&gt;images); echo HIKASHOP_LIVE.$config-&gt;get('uploadfolder').$image-&gt;file_path;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg1NjAtcGhwLWNvZGUtdG8tZGlzcGxheS1wcmljZS1hbmQtaW1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.064 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
