Forum Replies Created
-
AuthorPosts
-
Tim KerremansParticipant
Hi,
The code you gave is the exact same code as I gave in my first message.
I understand that there must be a default title, I just want to obligate my vendors to change this default title.Kind regards,
June 17, 2022 at 2:24 AM in reply to: Displaying message after vendor selected product category on add-product page #138010Tim KerremansParticipantCan you send me the hook so that I can look into it?
Thanks!
June 13, 2022 at 9:12 PM in reply to: Set min and max image resolution only on edit-product page #137917Tim KerremansParticipantHi,
Like I said in my previous message, this is not working. Replacing add-product with edit-product does not work on my end. Please look at my previous message
June 11, 2022 at 5:56 PM in reply to: Set min and max image resolution only on edit-product page #137875Tim KerremansParticipantHi, thanks for digging deeper into this. I have tried but unfortunately it’s not working on my end. The vendors are uploading the file on the edit-product page and not on the add-product page. Could that be the issue here? I already tried changing add-product to edit-product in the code but it’s not working.I guess because there is always the product id attached at the end of the url?
I attached a screenshot of the error message I’m receiving
June 10, 2022 at 12:19 PM in reply to: Set min and max image resolution only on edit-product page #137836Tim KerremansParticipantSo you’re telling there is no way to exclude 2 urls from this function? We’re not trying to change the world here.. I mean I’m just trying to exclude 2 pages from a basic function. We should find a solution to this
June 9, 2022 at 12:49 PM in reply to: Set min and max image resolution only on edit-product page #137813Tim KerremansParticipantGreat, thank you!
June 8, 2022 at 8:01 PM in reply to: Set min and max image resolution only on edit-product page #137753Tim KerremansParticipantHi, thanks for getting back to me.
-> Correct, but on top of that also not on the profile page
These are the urls of the vendor shop page and profile page:
https://www.myurl.com/dashboard/profile/
https://www.myurl.com/dashboard/storefront/June 8, 2022 at 8:01 PM in reply to: Set min and max image resolution only on edit-product page #137752Tim KerremansParticipantThanks for getting back to me.
-> correct, but on top of that also not for the profile page if possible.
These are the urls of the vendor shop page and profile page:
https://myurl.com/dashboard/profile/
https://myurl.com/dashboard/storefront/Tim KerremansParticipantSome additional information about the custom flow:
Once the vendor clicks on a product category when adding a product it will automatically create all attributes and variations. For each variation the vendor is able to set the commission which is calculated in a different way than default like I explained above. This is done by a custom created plugin which overrides default Woocommerce flow. The screenshot I attached in my previous messages are from that plugin
Tim KerremansParticipantHere is the third screenshot
Tim KerremansParticipantHi,
Thanks for getting back to me. I have a custom flow which allows the commission to be calculated based on the cost of the product for the vendor.
For example:
Cost of item = 50$
Commission = 20% or 10$
Will result in selling price of customer = 60$ (50 + (20%*50))I have attached multiple screenshots and highlighted the field in which I would like to display ’20’ as default value but leave editable for vendors.
Kindly let me know if you need any additional help
June 4, 2022 at 12:02 AM in reply to: Set min and max image resolution only on edit-product page #137677Tim KerremansParticipantHi,
Thanks for your response but I don’t want to modify the logo as the minimum resolution of the uploaded product files has to be 1080p, if I modify logo and banner picture to be 1080p on the shortest side it would make waaay to large files on my website. I just want to exlude the shopfront and profile page from the funtion so that they are not affected in any way
June 3, 2022 at 2:52 AM in reply to: Set min and max image resolution only on edit-product page #137661Tim KerremansParticipantHi,
Thanks for helping me out, however I’m still not able to get it working. Can you include this function into the code I received earlier? Also, would it also be possible to prevent this code from working on the profile page as well? The vendors can upload their profile image so I don’t want to set the limitations over there. You would help me alot.
Thanks in advance!
April 21, 2022 at 3:26 PM in reply to: Set min and max image resolution only on edit-product page #136689Tim KerremansParticipantI figured that I could also check for page template to disable this funtion on shopfront page, however when I try following code it is still working on the shopfront page. Any idea what I’m doing wrong here?
if ( !is_page_template( ‘shop-front’ ) ) { // name of template you don’t want to run it on
function resize_image_resolution($file) {
if(is_user_wcmp_vendor(get_current_user_id())){
$image = getimagesize($file[‘tmp_name’]);
$minimum = array(
‘width’ => ‘1080’, //set your minimum
‘height’ => ‘1080’
);
$maximum = array(
‘width’ => ‘12000’, //set your maximum
‘height’ => ‘12000’
);
$image_width = $image[0];
$image_height = $image[1];$too_small = “Image dimensions are too small.”;
$too_large = “Image dimensions are too large.”;if ( $image_width < $minimum[‘width’] || $image_height < $minimum[‘height’] ) {
$file[‘error’] = $too_small;
return $file;
}
elseif ( $image_width > $maximum[‘width’] || $image_height > $maximum[‘height’] ) {
$file[‘error’] = $too_large;
return $file;
}
else
return $file;
} else {
return $file;
}
}add_filter(‘wp_handle_upload_prefilter’, ‘resize_image_resolution’);
}April 15, 2022 at 6:26 PM in reply to: Set min and max image resolution only on edit-product page #136503Tim KerremansParticipantYes thanks but where do I have to add this hook? Can you provide me the complete code with this hook already applied to it?
-
AuthorPosts