ZaxxaDK Posted August 8, 2016 Share Posted August 8, 2016 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 More sharing options...
rocky Posted August 8, 2016 Share Posted August 8, 2016 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. Link to comment Share on other sites More sharing options...
ZaxxaDK Posted August 9, 2016 Author Share Posted August 9, 2016 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 More sharing options...
rocky Posted August 9, 2016 Share Posted August 9, 2016 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 More sharing options...
ZaxxaDK Posted August 9, 2016 Author Share Posted August 9, 2016 (edited) 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 Edited August 9, 2016 by ZaxxaDK (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted August 10, 2016 Share Posted August 10, 2016 No, it shouldn't be inside your module. It must be the img directory in the root. For example, /img/s/1.jpg is the image for the carrier with an ID of 1. Link to comment Share on other sites More sharing options...
ZaxxaDK Posted August 11, 2016 Author Share Posted August 11, 2016 Thank you Rocky! you are my hero Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now