Перейти к содержимому


Фотография
- - - - -

JBZoo Price


  • Закрытая тема Тема закрыта
Сообщений в теме: 22

#1 P.K

P.K

Отправлено 05 November 2013 - 18:17

Hi

The price i want to fill in the the jbzoo cart is fetched from another script and is in the form of php script which gives the numeral value when run. Now the problem is that which file and how should i modify the jbzoo cart file such that the price is automatically fetched from the script and there is no need to enter the value in the backend when creating the item.

 

Thanks


  • 0

#2 Kess

Kess

Отправлено 05 November 2013 - 19:58

Hello,

 

I don't think that you should modify any of the JBZoo files for that. Wouldn't it be better if you just update the price values in the database with your script? So you'll just have to run this script from time to time when prices change. Like an import but without using csv files.


  • 0

#3 P.K

P.K

Отправлено 05 November 2013 - 20:06

Hi
The problem is that my price change is too frequent that it would be better if the price in the cart is fetched from my script's database. And it would be difficult for me to update the price form the database. It is just a few lines of code which i need to place and which will provide numeric price when executed by jbzoo cart. The code is as simple as 
<?php
  print pg_replace(array("","price","","Product Name"));
?>
 
Please suggest
thanks
  • 0

#4 Kess

Kess

Отправлено 06 November 2013 - 12:34

Ok, there is one solution that you can try.

 

In the file

media/zoo/applications/jbuniversal/elements/jbpriceadvance/jbpriceadvance.php

 

find a function "_getBasicData()"

 

There is a line in it:

'value'             => isset($data['basic']['value']) ? (float)$data['basic']['value'] : 0,

Try replacing this declaration with the data from your script.

 

This should work, but there might be a problem with filters, so you'll need to try and see how it works.


  • 1

#5 P.K

P.K

Отправлено 09 November 2013 - 16:09

Hi

Which variable has the name of the product in the jbpriceadvance.php?

 

yes the slider is not working properly. will update you soon about the problem

Thanks


  • 0

#6 Kess

Kess

Отправлено 09 November 2013 - 17:06

To get the name you can use

$this->getItem()->name

  • 0

#7 P.K

P.K

Отправлено 10 November 2013 - 05:46

Hi

Will the name be in the same format as it appears in the url for ex for product Lenovo A10 the url is like lenovo-a10???

 

thanks


  • 0

#8 P.K

P.K

Отправлено 10 November 2013 - 06:05

The problem is that in the statement

  1. print pg_replace(array("","price","","Product Name"));

 

I need to have the product name in the format lenovo-a10 . So the problem solves if it is like

 

  1. print pg_replace(array("","price","","lenovo-a10"));

So how do i use the variable for the name in the jbzooadvance.php??

 

Thanks


  • 0

#9 Kess

Kess

Отправлено 10 November 2013 - 07:53

The 

$this->getItem()->name

will return the normal name of a product, like the one that you type when creating new product.

 

For your script you can try using

$this->getItem()->alias;

This returns an alias of an item. It seems that its format is what you need.


  • 0

#10 P.K

P.K

Отправлено 10 November 2013 - 09:40

Hi

This solves the problem of the price. Now the problem that remains is 

 

The price is displayed in the format 32.200,00 € which is incorrect. The format which my is supplied from my database is 32200.00. So what needs to be done?

Also the currency i wish to use is INR (Rs. )  which is not in the jbzoo currency list.

 

 

Thanks


  • 0




Click to return to top of page in style!