Site Configuration by Server Params (confsites and confpages)
This commit is contained in:
@@ -9,6 +9,8 @@ import { tools } from '@store/Modules/tools'
|
||||
import { defineStore } from 'pinia'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from './globalStore'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useProducts = defineStore('Products', {
|
||||
state: (): IProductsState => ({
|
||||
@@ -127,9 +129,11 @@ export const useProducts = defineStore('Products', {
|
||||
async loadProducts() {
|
||||
|
||||
const userStore = useUserStore()
|
||||
console.log('loadProducts')
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
// console.log('loadProducts')
|
||||
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
console.log('getProducts', 'userid=', userStore.my._id)
|
||||
@@ -170,8 +174,9 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
console.log('loadProduct', code)
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
console.log('getProduct', 'code', code)
|
||||
@@ -204,8 +209,9 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
console.log('loadOrders')
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
console.log('loadOrders', 'userid=', userStore.my._id)
|
||||
@@ -256,8 +262,9 @@ export const useProducts = defineStore('Products', {
|
||||
async addToCart({ product, order }: { product: IProduct, order: IOrder }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
const neworder = this.createOrderByProduct(product, order)
|
||||
@@ -293,7 +300,9 @@ export const useProducts = defineStore('Products', {
|
||||
async addSubQtyToItem({ addqty, subqty, order } : { addqty: boolean, subqty: boolean, order: IOrder }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
// console.log('addSubQtyToItem', 'userid=', userStore.my._id, order)
|
||||
@@ -326,8 +335,9 @@ export const useProducts = defineStore('Products', {
|
||||
async UpdateStatusCart({ cart_id, status }: { cart_id:string, status: number }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
// console.log('addSubQtyToItem', 'userid=', userStore.my._id, order)
|
||||
@@ -356,8 +366,9 @@ export const useProducts = defineStore('Products', {
|
||||
async UpdateOrderStatus({ order_id, status }: { order_id: string, status: number }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (!static_data.functionality.ENABLE_ECOMMERCE)
|
||||
if (!globalStore.site.confpages.enableEcommerce)
|
||||
return null
|
||||
|
||||
// console.log('addSubQtyToItem', 'userid=', userStore.my._id, order)
|
||||
|
||||
Reference in New Issue
Block a user