Jump to content

Admin source code help?


Recommended Posts

Hi guys

it been a while since I have needed technical help here :-P
I have just one technical question regarding the admin source code which I hope you can point me in the right direction.
having worked on a conversion from oscomemrce & created several image hacks which all work well on the front end & modules.

the trouble is I need to add a image to the array below
for example the code below shows a few modifications to display the old image which is a new filed I have added in the DB. Currently with the code below displays only the value for this filed, which is correct.
ie. the name of the old image but it needs to be shown in the admin table as an image.

I have successfully made these small image hacks everywhere else & when I get this working i would be happy to share my solution with the rest of the community once this is solved.

This actual image hack is used to display the image field from other MYSQL shopping carts such as oscommerce
the way it works is if the old image exists replace the Prestashop image system.

But when a user uploads a new image this will then override the image & resume normal functioning to this shopping cart
All I have done is batch 3 different sizes of all the products which works just as good as the Prestashop function without pixulating the image, although I am struggling with the admin code below.

Hope someone can help :roll:
I think my problem lies with this line
$old_image = $obj->old_image;

adminproducts.php line 23

    public function __construct()
   {
       global $currentIndex;
       $old_image = $obj->old_image;
       $this->table = 'product';
       $this->className = 'Product';
       $this->lang = true;
       $this->edit = true;
       $this->view = false;
       $this->duplicate = true;
       //$this->old_image = '';
       $this->imageType = 'jpg';            

       $this->fieldsDisplay = array(
           'id_product' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 20),
           'image' => array('title' => $this->l('Photo'), 'align' => 'center', 'image' => 'p', 'width' => 45),
           'old_image' => array('title' => $this->l('Old Photo'), 'align' => 'center', 'old_image' => $this->old_image, 'width' => 15),
           'name' => array('title' => $this->l('Name'), 'width' => 323, 'filter_key' => 'b!name'),
           'price' => array('title' => $this->l('Base price'), 'width' => 70, 'price' => true, 'align' => 'right', 'filter_key' => 'a!price'),
           'price_final' => array('title' => $this->l('Final price'), 'width' => 70, 'price' => true, 'align' => 'right'),
           'quantity' => array('title' => $this->l('Quantity'), 'width' => 30, 'align' => 'right', 'filter_key' => 'a!quantity', 'type' => 'decimal'),
           'position' => array('title' => $this->l('Position'), 'width' => 40, 'align' => 'center', 'position' => 'position'),
           'active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'orderby' => false));

Link to comment
Share on other sites

×
×
  • Create New...