1. 首页
  2. 跨境营销

shopify重置价格

#--encoding:utf-8-

import xlrd

file_path = r’E:/Book3.xlsx’

shopify重置价格

#文件路径的中文转码,如果路径非中文可以跳过
#获取数据
data = xlrd.open_workbook(file_path)
#获取sheet 此处有图注释(见图1)
table = data.sheet_by_name(‘Sheet1’)
#获取总行数
nrows = table.nrows

longy={}
costlist={}
for ind in range(0,nrows):
rowvalue = table.row_values(ind)
pid=str(int(rowvalue[0]))
skuid=int(rowvalue[1])
costprice=round(float(str(rowvalue[2])),2)
productonname=str(str(rowvalue[3]))

longy[str(skuid)+’’]={
‘pid’:pid,
‘skuid’:skuid,
‘costprice’:costprice,
‘productonname’: str(productonname+’’)
}

import csv
filename = ‘E://ball.csv’

r = csv.reader(open(filename,encoding=‘utf-8’)) # Here your csv file
lines = [l for l in r]
for line in lines:
if line[19]‘Variant Price’:
continue
if line[19]
’’:
continue
if line[13]==’’:
continue

Vsku=line[13].split("’")[1]

if line[46]==’’:
# print(’——————————’)
line[46]=str(costlist[Vsku])
# print(str(costlist[Vsku]))

costper=round(float(str(longy[Vsku][‘costprice’])))
print(costper)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)
line.append(’’)

line[45]=costper
price=round(costper,2)*2/6.5
line[19]=price

oldtag=line[5]
tag=‘0-2.99’
if float(price) > 10:
tag=‘10 and above’
elif float(price) > 7.99:
tag=‘8-9.99’
elif float(price) > 4.99:
tag=‘5-7.99’
elif float(price) > 2.99:
tag=‘3-4.99’
line[5]=oldtag.replace(“0-2.99”, tag).replace(“3-4.99”, tag).replace(“5-7.99”, tag).replace(“8-9.99”, tag).replace(“10 and above”, tag);

writer = csv.writer(open(‘E:new.csv’, ‘w’,encoding=‘utf-8’,newline=’’))
writer.writerows(lines)
print(‘finsh!’)

原文链接:https://blog.csdn.net/qq_38402659/article/details/108776679?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167193311916800217089654%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=167193311916800217089654&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-17-108776679-null-null.blog_rank_default&utm_term=Shopify

你可能感兴趣

Shopify如何设置google аnalytics?

Shopify如何设置google аnalytics? Trafficcn 2018-07-20 15:21:25在设置google аnalytics(谷歌分析)之前我

Bing UET Tag 全局+赋值代码安装步骤(Shopify建站)

Shopify建站有两站代码安装方式,1)使用插件一键安装,2)手动编辑。如需使用插件一键安装,请联系西窗AM来获取插件&#xff

判断浏览器信息,及当前浏览网页使用的设备

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF

shopify结账页面优化_shopify商店的速度和性能优化

For the last few weeks, I have been working on projects related to the speed and performance testing

shopify api php 开发,Shopify 二次开发 配置本地开发教程 最详细详解

摘要身为 shopify 网站管理者与开发者 时常需要根据需求去编辑代码,进行少量的代码编辑在页面上编辑还好,但是需要编辑大量的代码则是非常不方便的,因此需要

shopify模板下载本地

第一步安装chocolatey 直接去官网按照步骤进行操作https://chocolatey.org/install如果执行命令过程X现下边报错 说明电脑已经安装过了An existing Cho

订单30分钟未支付,则自动取消,该怎么实现?

在开发中,往往会遇到一些关于延时任务的需求。例如生成订单30分钟未支付,则自动取消生成订单60秒后,给用户发短信对上述的任务,我们给一个专业的名字来形容&#x

shopify 属性添加图片及样式

<style> .custom-sax{ float:left; width:100%;} .custom-sax li{ float:left; width:23%; padding

Shopify平台 Bing UET Tag升级动态再营销(Dynamic Remarketing)代码

目录1.首页、合集页、搜索页、商品页和常规页面2.支付成功页代码:1.首页、合集页、搜索页、商品页和常规页面以下代码添加到shopify后台theme.liquid文件中</hea

shopify开发经验

1.任意页面直接跳转checkout页面目前shopify 购买按钮直接跳转到结账页面,shopify没有提供官方方法,但是 有一个黑科技方法,通过模拟 提交

原创文章,作者:starterknow,如若转载,请注明出处:https://www.starterknow.com/327.html

联系我们