Closed rroveri closed 8 years ago
Hi @rroveri Good idea!
Hi @owen2345,
Yeah its nice to have variants, but while implementing this feature if possible refer to Shopify implementation once, adding variants can be very confusing if its not properly implemented. I am attaching few screen shots from Shopify create product page.
Also please note that only Shopify automatically creates SKUs for variants, really its useful feature to have SKUs get created automatically for variants, otherwise it would be confusing for users. Also pls plan to upload individual image upload for variants, so that each variant has different image, if there are no images uploaded then it will show from main product.
@mazharoddin it appears complex hehe!
@oweb2345, for you it won't be complex :)
but, I was looking for some job to get some money, because I was fulltime with Camaleon without getting money. hehe!
@owen2345 , true ...money also important factor..I agree ... Whenever you feel or try to implement ..then consider shopify implementation, otherwise it may be really confusing ..now even without this option product pages are useful, atleast they are not complex.
Hi @mazharoddin I added the product variations, could you please test it?
Regards,
Sure @owen2345...Thanks
Hi @owen2345, I am unable to test, I am getting below error while trying to add variant image.
Completed 500 Internal Server Error in 180ms (ActiveRecord: 3.8ms)
MiniMagick::Error (`mogrify -resize nullx /var/folders/kc/y4gc2tps1pxdv5ty4n4syjp80000gn/T/mini_magick20160709-13273-eqaa99.jpg` failed with error:
mogrify: invalid argument for option `nullx': -resize @ error/mogrify.c/MogrifyImageCommand/5799.
):
mini_magick (4.5.1) lib/mini_magick/shell.rb:18:in `run'
mini_magick (4.5.1) lib/mini_magick/tool.rb:92:in `call'
mini_magick (4.5.1) lib/mini_magick/tool.rb:40:in `new'
mini_magick (4.5.1) lib/mini_magick/image.rb:504:in `mogrify'
mini_magick (4.5.1) lib/mini_magick/image.rb:384:in `combine_options'
/Users/mazharoddin/.rvm/gems/ruby-2.2.2@rails4.2.5/bundler/gems/camaleon-cms-55fcf12d0190/app/helpers/camaleon_cms/uploader_helper.rb:145:in `cama_crop_image'
/Users/mazharoddin/.rvm/gems/ruby-2.2.2@rails4.2.5/bundler/gems/camaleon-cms-55fcf12d0190/app/helpers/camaleon_cms/uploader_helper.rb:245:in `cama_resize_upload'
/Users/mazharoddin/.rvm/gems/ruby-2.2.2@rails4.2.5/bundler/gems/camaleon-cms-55fcf12d0190/app/helpers/camaleon_cms/uploader_helper.rb:39:in `upload_file'
/Users/mazharoddin/.rvm/gems/ruby-2.2.2@rails4.2.5/bundler/gems/camaleon-cms-55fcf12d0190/app/controllers/camaleon_cms/admin/media_controller.rb:79:in `upload'
I tried to update ImageMagick on my Mac, but I already have latest version,
brew upgrade ImageMagick
Error: imagemagick 6.9.2-7 already installed
hi @owen2345, I am getting below error if I try to add a product without variants.
undefined method `keys' for nil:NilClass
Extracted source (around line #79):
def ecommerce_admin_product_created(args)
if args[:post_type].slug == 'commerce'
args[:post].product_variations.where.not(id: params[:product_variation].keys).delete_all
params[:product_variation].each do |p_key, p_var|
data = {amount: p_var[:price], photo: p_var[:photo], sku: p_var[:sku], weight: p_var[:weight], qty: p_var[:qty], attribute_ids: p_var[:attributes].map{|at| at[:value] }.join(',')}
if p_key.include?('new_') # new variation
vendor/plugins/camaleon-ecommerce/app/helpers/plugins/ecommerce/ecommerce_helper.rb:79:in `ecommerce_admin_product_created'
Here is the repository details.
github.com:mazharoddin/camaleon_cms_debug.git
-Thanks.
@mazharoddin Fixed variations! I tried many times to reproduce the imagemagick problem, but without success.
Sure np, Let me re-try. Thanks.
@owen2345 ,
Now I am able to create product with variants. But I am getting below error if I try to create a variant without adding product attributes.
undefined method `map' for nil:NilClass
args[:post].product_variations.where.not(id: params[:product_variation].keys).delete_all
params[:product_variation].each do |p_key, p_var|
data = {amount: p_var[:price], photo: p_var[:photo], sku: p_var[:sku], weight: p_var[:weight], qty: p_var[:qty], attribute_ids: p_var[:attributes].map{|at| at[:value] }.join(',')}
if p_key.include?('new_') # new variation
args[:post].product_variations.create(data)
else
vendor/plugins/camaleon-ecommerce/app/helpers/plugins/ecommerce/ecommerce_helper.rb:82:in `block in ecommerce_admin_product_created'
actionpack (4.2.6) lib/action_controller/metal/strong_parameters.rb:185:in `each_pair'
Can you please create some default 'Product Attributes' whenever user activates eCommerce plugin.
Color, Size and material etc attributes are commonly used, these can be created by default. What do you think.
Imagemagick error I am getting only with variants images, normal product image upload is working fine with out any issue. I am unable to insert existing images in variants.
If I try to upload new image I am getting this error.
Completed 500 Internal Server Error in 86ms (ActiveRecord: 1.1ms)
MiniMagick::Error (`mogrify -resize nullx /var/folders/kc/y4gc2tps1pxdv5ty4n4syjp80000gn/T/mini_magick20160712-30646-idd5h3.jpg` failed with error:
mogrify: invalid argument for option `nullx': -resize @ error/mogrify.c/MogrifyImageCommand/5799.
):
mini_magick (4.5.1) lib/mini_magick/shell.rb:18:in `run'
Fixed! The problem was a null value sent from js
Thanks @owen2345, let me check if its working.
Hi @owen2345, I am able to crop the images now, but dimensions are not getting updated if I use cloudfront/S3 images, so am unable to insert image( insert option is blank).
Fixed image insert
Thanks @owen2345
It would be useful to have different prices for different versions of the same product (red, green, blue, ...)