overhangio / tutor-ecommerce

Ecommerce plugin for Tutor
GNU Affero General Public License v3.0
17 stars 50 forks source link

Some problems encountered during my deployment. #2

Closed sodaling closed 4 years ago

sodaling commented 5 years ago

Hi @regisb !When I deploy this plugin, there are some things I want to discuss with you.

  1. About the ecommerce payment processors setting,the plugin has been done very well.But it still need a init-hook.If u create a new ecommerce payment processors like alipay.The new value of waffle switch about this processor should be created and actived(ecommerce document).I found the command is :
    ./manage.py waffle_switch     payment_processor_active_alipay on

    2.When I changed the default ecommerce repo to ours for building image,it got an error on this step:

    RUN python manage.py compress --force

    It printed: image But after i modified the assets.py

    # from .base import *
    from .production import *

    Then this step is executed smoothly. But:

    RUN echo "{}" > /openedx/config.yml
    ENV ECOMMERCE_CFG /openedx/config.yml

    should be executed before the action of RUN make theme_static

  2. There's some configuration should be set in tutor.py
    SCAR_DEFAULT_CURRENCY = 'CNY'
    CURRENCY_SYMBOL = '¥'

    These configurations are generic but not required. Do u have any suggestion of these configurations where to patch?

  3. The reason of this PR as same as that.
sodaling commented 5 years ago

Is there a mistake in README?

tutor config save \ --set 'ENABLED_PAYMENT_PROCESSORS=["myprocessor"]' \ --set 'ENABLED_CLIENT_SIDE_PAYMENT_PROCESSORS=["myprocessor"]' \

Maybe it should be

tutor config save \ --set 'ECOMMERCE_ENABLED_PAYMENT_PROCESSORS=["myprocessor"]' \ --set 'ECOMMERCE_ENABLED_CLIENT_SIDE_PAYMENT_PROCESSORS=["myprocessor"]' \

sodaling commented 5 years ago

BTW,thanks for your patiention. And I studied a lots from your code.

xavierchan commented 5 years ago

Hi, @regisb . How is it going? I think you are having a good trip. These time we work with tutr-ecommerce. We have some problem hope you can support us.

  1. The config.yml in tutor-ecommerce image seem has no hook for change(That is also possible i just don't know), so what's your suggestion for this?
  2. Like @sodaling , when we want to build our ecommerce image, it will fail because of the problem code in assets.py.
  3. We had make alipay and wechatpay work in our project. If we want to active a new payment processer, we have to created and actived(ecommerce document). But now in tutor-ecommerce, it seems have not related processing. Can you strengthen it? Or make admin-manage more flexible and customize?

Look forward to your reply~~

regisb commented 5 years ago

@sodaling:

  1. About the ecommerce payment processors setting,the plugin has been done very well.But it still need a init-hook.If u create a new ecommerce payment processors like alipay.The new value of waffle switch about this processor should be created and actived(ecommerce document).I found the command is : ./manage.py waffle_switch payment_processor_active_alipay on

If I understand correctly, this waffle switch is only required to disable the payment processor. It is not necessary in order to enable it, because by default it is equal to true.

How did you realize that you needed this waffle switch?

2.When I changed the default ecommerce repo to ours for building image,it got an error on this step: RUN python manage.py compress --force

The assets compression inside the ecommerce image should not depend on the production settings. The assets.py settings are supposed to be minimal settings defined just to collect and compress assets. It looks like the journal_bundleoffer_form.html template from your fork requires production settings. These settings will differ from one user to another, and thus we cannot rely on production.py for all users. What we can do is find out which setting is missing from assets.py and add it there.

  1. There's some configuration should be set in tutor.py OSCAR_DEFAULT_CURRENCY = 'CNY' CURRENCY_SYMBOL = '¥'

It makes sense to add new settings to the ecommerce plugin. Would you like to open a PR? Basically, you would have to add new default settings to plugin.py and templates/ecommerce/apps/tutor.py.

  1. The reason of this PR as same as that.

Let's talk about this PR on the PR page.

Is there a mistake in README?

Yes indeed! It was fixed in an earlier commit.

@xavierchan:

The config.yml in tutor-ecommerce image seem has no hook for change(That is also possible i just don't know), so what's your suggestion for this?

Why do you need to modify config.yml?

xavierchan commented 5 years ago

@regisb To be exact, we want to modify tutor-ecommerce's settings, but i don't know how to do it in current situation.

regisb commented 5 years ago

@xavierchan which settings would you like to modify?

xavierchan commented 5 years ago

@xavierchan which settings would you like to modify?

Not which one settings but a way to do it. I think it should be free to modify, like the plugin tutor-openedx_settings we done for lms and cms.

sodaling commented 5 years ago

It makes sense to add new settings to the ecommerce plugin. Would you like to open a PR? Basically, you would have to add new default settings to plugin.py and templates/ecommerce/apps/tutor.py.

These setting doesn't belong to edx-ecommerce but our repository. When we change the ecommerce repo to our's,there are some customized setting that we intend to add. How about adding a patch tag like you did before?

regisb commented 5 years ago

@xavierchan @sodaling Since you are running a fork of the ecommerce repo, why not directly add your settings to production.py?