hello, I am trying to do in my form that can upload and
crop a photo with cropperjs but I have a problem and it
seems that the id used in the input of the product form
is not <input type="hidden" name="feat_image_id"
class="dokan-feat-image-id" value="<?php echo esc_attr
(
$feat_image_id ); ? >"> because when I set it up it
works but if I put that id "feat_image_id" does not
recognize it as the main photo of the ad I need to know
how would the id to implement the cropperjs on our
website because we have problems with the images to
upload them take very long and we realized that if you
upload a photo of 2000x2000 takes about 4 sec then our
solution would be that the customer can crop before
uploading the images greetings and thanks I leave the
codes I have that if I work..: but dont save it in my
forms on new product or edit product
edit-product-single.php
<input type="file" id="image-upload-input" name="image" accept="image/*">
<div id="image-preview"></div>
fuctions.php
function initialize_cropper_js() {
?>
<script>
jQuery(document).ready(function($) {
document.addEventListener("DOMContentLoaded", function() {
var imageUploadInput = document.getElementById('image-upload-input'); // Reemplaza 'image-preview' con el ID o la clase de tu campo de selección de imágenes en el formulario de Dokan
var imagePreview = document.getElementById('feat_image_id');
imageUploadInput.addEventListener('change', function() {
var file = this.files[0];
var reader = new FileReader();
reader.onload = function(e) {
var img = document.createElement('img');
img.src = e.target.result;
imagePreview.innerHTML = ''; // Limpiar la vista previa anterior
imagePreview.appendChild(img);
var cropper = new Cropper(img, {
aspectRatio: 1 / 1, // Opcional: define la relación de aspecto deseada
viewMode: 2, // Opcional: modo de vista (0, 1, 2, 3)
dragMode: 'crop', // Opcional: modo de arrastre ('crop', 'move', 'none')
responsive: true // Opcional: activar el modo responsive
});
};
reader.readAsDataURL(file);
});
});
});
</script>
<?php
}
add_action( 'wp_footer', 'initialize_cropper_js' );
]]>It seems it has to do with one of the latest update of Dokan.
The error I am getting is
PHP Fatal error:? Uncaught Error: Call to undefined function WeDevs\Dokan\dokan_get_option() in /srv/htdocs/wp-content/plugins/dokan-lite/includes/Rewrites.php:19
Can you confirm this error is coming from Dokan plugging or is not related?
]]>This is my first topic, so I hope I can explain myself.
For some reason, when I create a new product everything seems to work fine until I publish it, go to the single page and then, I get a critical error from wordpress.
It only happens when the product is new, but if I duplicate it from the ones I created a dew works fine. And if I deactivate the plugin, I do not get this error.
I am wondering what could it be, so I hope you can help me with this because your plugin gives a great feature.
]]>https://gyazo.com/4df36ad48e93c47f3465f02350238e8d
How the hell do we get rid of this so we can get back to adding products the old way. Just let my type in my description and add all the productin information down below
]]>When a vendor wants to add a new product on his dashboard, it is difficult to select the proper “product categories or subcategories” specially when the marketplace has hundreds or thousands of categories.
Can you make the categories easier to display and list on the new product page in a category tree format?
I found under “Dashboard Setting” > Disable Category Checklist
I unchecked it.. It make the Main Categories as a Drop Down with an arrow. However, the subcategories don’t have an expansion option.
For example add a (+) to expand or collapse the subcategories and to select the child subcategories for 2nd level, 3rd, etc.
Thanks
]]>