Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the code for the DBIC feature (#5133) #5137

Closed

Conversation

ymaheshwari1
Copy link
Contributor

Related Issues

#5133

closes #5133

Short Description and Why It's Useful

It lets use to define the specific countries that we want to include in the storefront.
Related to: vuestorefront/vsf-capybara#532

Which Environment This Relates To

Check your case. In case of any doubts please read about Release Cycle

  • Test version (https://test.storefrontcloud.io) - this is a new feature or improvement for Vue Storefront. I've created branch from develop branch and want to merge it back to develop
  • RC version (https://next.storefrontcloud.io) - this is a stabilisation fix for Release Candidate of Vue Storefront. I've created branch from release branch and want to merge it back to release
  • Stable version (https://demo.storefrontcloud.io) - this is an important fix for current stable version. I've created branch from hotfix or master branch and want to merge it back to hotfix

Upgrade Notes and Changelog

  • No upgrade steps required (100% backward compatibility and no breaking changes)
  • I've updated the Upgrade notes and Changelog on how to port existing Vue Storefront sites with this new feature

IMPORTANT NOTICE - Remember to update CHANGELOG.md with description of your change

Contribution and Currently Important Rules Acceptance

@vercel
Copy link

vercel bot commented Nov 6, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shopware-pwa/vue-storefront/9ul6w7dkp
✅ Preview: https://vue-storefront-git-feature-dbic-feature.shopware-pwa.vercel.app

@vercel vercel bot temporarily deployed to preview November 6, 2020 05:16 Inactive
@vercel vercel bot temporarily deployed to preview November 16, 2020 11:36 Inactive
@vercel vercel bot temporarily deployed to preview November 16, 2020 11:39 Inactive
Copy link
Collaborator

@Fifciu Fifciu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not so sure about this approach. It is possible to setup it in magento2 and fetch this information based on current store code. I think it would be a better approach.

We would need to do it for M1 & M2 backend.

Code of VSF-API extensions which would access this data from Magento2:

import { apiStatus, apiError } from '../../../lib/util';
import { Router } from 'express';
import { multiStoreConfig } from '../../../platform/magento2/util';
const Magento2Client = require('magento2-rest-client').Magento2Client;

module.exports = ({ config, db }) => {
  let mcApi = Router();

  mcApi.get('/', (req, res) => {

    const client = Magento2Client(multiStoreConfig(config.magento2.api, req));

    client.addMethods('countries', function(restClient) {
      var module = {};

      module.get = function() {
        return restClient.get('/directory/countries');
      };
      return module;
    });

    client.countries
      .get()
      .then(result => {
        apiStatus(res, result, 200);
      })
      .catch(err => {
        apiError(res, err);
      });
  });

  return mcApi;
};

This endpoint also supports multistore with an approach like: https://docs.vuestorefront.io/guide/integrations/multistore.html#update-append-a-storecode-to-your-url

So you should use adjustMultistoreApiUrl client side.
Can you handle it?

@bloodf
Copy link
Contributor

bloodf commented Aug 31, 2021

This is closed due to inactivity.

If you want your PR to be re-opened, please update your files, check for any conflicts.

If your PR is for Vue Storefront 1 target the new repository at https://github.com/vuestorefront/vue-storefront-1

@bloodf bloodf closed this Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants