FriendsOfShopware / FroshShareBasket

This plugin allows your customers to save the current basket and share it via link.
MIT License
8 stars 5 forks source link

AttributeData cannot be loaded when using a subdomain like https://backend.example.com/backend #18

Closed ray-magini closed 4 years ago

ray-magini commented 4 years ago

Actual behaviour

Our Frontend is reachable under https://www.example.com and our backend under https://backend.example.com/backend.

When opening 'Store additional fields' within the plugin config to retrieve the possible attributes the plugin tries to reach the following URL: https://backend/AttributeData/list?raw=1&table=s_order_details_attributes&_dc=1586171977581&page=1&start=0&limit=25 This runs into an error as 'backend' is for sure not valid.

Issue

The store 'url' in Resources/config.xml is not working when using a subdomain which includes 'backend'

grafik

Potential solution

  1. Make the url relative

    proxy: {
    type: 'ajax',
    url: '/backend/AttributeData/list?raw=1&table=s_order_details_attributes',
    reader: {
        type: 'json',
        root: 'data',
        totalProperty: 'total'
    }
    }
  2. Or a different structure

    proxy: {
    type: 'ajax',
    url: window.location.protocol + '//' + window.location.hostname + '/backend/AttributeData/list?raw=1&table=s_order_details_attributes',
    reader: {
        type: 'json',
        root: 'data',
        totalProperty: 'total'
    }
    }

How can this fix be considered (eg. opening a pull request)?

Thanks, Dirk

shyim commented 4 years ago

Fixed with #19