These are chat archives for mirumee/saleor

21st
Aug 2018
asalt
@asalt
Aug 21 2018 12:34
Hey guys thought I'd ask again: I've added a new field to the product form but cannot get the entry in the ajax response data. Where should I be looking (presumably within the javascript) to change this?
Filip Kucharczyk
@Pacu2
Aug 21 2018 12:41
I'd guess it would be cart.js component
asalt
@asalt
Aug 21 2018 12:42
I tried adding my form ID at:
asalt
@asalt
Aug 21 2018 12:43
    let quantity = $('#id_quantity').val();
    let variant = $('#id_variant').val();
    let custom = $('#id_custom').val();
    $.ajax({
      url: $('.product-form').attr('action'),
      type: 'POST',
      data: {
        variant: variant,
        quantity: quantity,
        custom: custom

      },
but never get a custom return value
ok well sounds like i'm at the right place at least
Filip Kucharczyk
@Pacu2
Aug 21 2018 12:44
This message was deleted
asalt
@asalt
Aug 21 2018 12:45
when I look at the product_add_to_cart request.POST I only see variant and quantity
that I believe is next function that gets called
Filip Kucharczyk
@Pacu2
Aug 21 2018 12:46
Have you recompiled your js files after updating them?
asalt
@asalt
Aug 21 2018 12:46
I have ensured that my custom field is part of the same form group as the others
now that I haven't done
sorry my js experience is limited - I'll give that a try and see if that works
Filip Kucharczyk
@Pacu2
Aug 21 2018 12:52
We are converting all storefront-related js chunks into storefront.js file with webpack, please run npm run build-assets (or npm run watch to make it continous) to make sure your storefront.js file is refreshed, also you could insert a debugger to your js code to make sure everything is in place
asalt
@asalt
Aug 21 2018 12:57
Thanks I will try it
asalt
@asalt
Aug 21 2018 13:45
@Pacu2 Thanks it all works.
thanks for the help
asalt
@asalt
Aug 21 2018 14:53
and it seems (you may already be aware) it is not straightforward to add new custom form inputs when show_variant_picker is True in the product_details func - this is because the form is put together (dynamically?) within the js assets. Maybe it is straightforward to others who know more javascript than I do! Fortunately I can just set show_variant_picker to False and control the form construction in the html template - I'm OK with this solution for my needs.
Lebzanwa
@Lebzanwa
Aug 21 2018 18:02
Hi, guys.. Is there video or tutorail on installing Saleor in a Windows 10 for offline installation.?
Stephen Moloney
@stephenmoloney
Aug 21 2018 18:53
the easiest way i can think of would be to install docker onto windows...
then just use docker-compose
i don't know of a video.
Николай Инкогнито
@mmmsvit_gitlab
Aug 21 2018 19:39

Are possible use: Django Redis Session (https://github.com/martinrusev/django-redis-sessions#available-settings) ? I try, just add:

if not CACHES['default']['BACKEND'].endswith('LocMemCache'):
    SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'

SESSION_ENGINE = 'redis_sessions.session'
SESSION_REDIS = {
    'host': 'localhost',
    'port': 6379,
    'db': 7,
    'password': '',
    'prefix': 'session',
    'socket_timeout': 1
}

all work fine

Miles
@milesstevenson
Aug 21 2018 23:28
Is there an existing api for saleor to use, similar to django-oscar-api?