Jump to content

Custom $Carrier - "upload" logo on creation?


Recommended Posts

Hey

 

I have made played around with making custom carriers, and its going pretty well so far - but now im wondering:

Is their a way to upload a image from the function im creating the custom carrier in? or anything like it

Link to comment
Share on other sites

Just copy the image to img/s/<carrier_id>.jpg and it should automatically be found. Change <carrier_id> to the ID of your custom carrier. The default image size is 40 x 40 pixel.

 

But isnt the carrier ID generated automaticly? or maybe their is a way i can set it myself?

Link to comment
Share on other sites

You're right. You'll need to execute a query after creating your carrier to get the last ID and then use that. For example:

$id_carrier = (int)Db::getInstance()->getValue('SELECT MAX(`id_carrier`) FROM `'._DB_PREFIX_.'carrier`);
Link to comment
Share on other sites

 

You're right. You'll need to execute a query after creating your carrier to get the last ID and then use that. For example:

$id_carrier = (int)Db::getInstance()->getValue('SELECT MAX(`id_carrier`) FROM `'._DB_PREFIX_.'carrier`);

tried to manually put in the image (before resetting the module) @ module/img/s/{carrier_id].jpg && module/views/img/s/{carrier_id].jpg neither worked - you are sure thats the place it picks up the logo from? or maybe im just not to bright :P

Edited by ZaxxaDK (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...