Advertisement
xah

ecommerce scripts v0.0.2

xah
Feb 19th, 2020 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.92 KB | None | 0 0
  1. class dglp:
  2.  
  3.     """Laptops provided by --
  4.    .data : Data entry prices (student prices, 10% markup, GST inclusive)
  5.    .detail : View all variations & prices (student prices, 10% markup, GST inclusive)
  6.    .public : View all variation prices for non-students (20% markup, GST inclusive)"""
  7.  
  8.     def data(basePrice):
  9.  
  10.         """Data entry prices arranged as provided order.
  11.        Data entry prices are student prices (10% markup, GST inclusive)
  12.        basePrice : GST exclusive, no markup price."""
  13.        
  14.         basePrice = int(basePrice) * 1.1
  15.  
  16.         print('Arrange attributes as ram > ssd\n')
  17.        
  18.         for r in ram.values():
  19.             for s in ssd.values():
  20.                  item = round((basePrice + r + s)*1.15, 3)
  21.                  print(str(round(item, 3)))
  22.  
  23.         print("\nCount : 6")
  24.  
  25.     def detail(basePrice):
  26.  
  27.         """Variation details in student prices (10% markup, GST inclusive)
  28.        basePrice : GST exclusive, no markup price."""
  29.  
  30.         basePrice = int(basePrice) * 1.1
  31.  
  32.         print("Arrange attributes as ram > ssd\n")
  33.        
  34.         for rk in ram.keys():
  35.             for sk in ssd.keys():
  36.                  item = round((basePrice + ram[rk] + ssd[sk])*1.15, 3)
  37.                  print(rk + sk + str(item))
  38.  
  39.         print("Count : 6")
  40.  
  41.     def public(basePrice):
  42.  
  43.         """Variation details in non-student prices (10% markup, GST inclusive)
  44.        basePrice : GST exclusive, no markup price."""
  45.  
  46.         basePrice = int(basePrice) * 1.1
  47.  
  48.         print("Arrange attributes as ram > ssd\n")
  49.        
  50.         for rk in ram.keys():
  51.             for sk in ssd.keys():
  52.                  item = round((basePrice + ram[rk] + ssd[sk])*1.15*1.1, 3)
  53.                  print(rk + sk + str(item))
  54.  
  55.         print("Count : 6")
  56.  
  57. class dgpc:
  58.  
  59.     """Desktop PCs provided by --
  60.    .data : Data entry prices (student prices, 10% markup, GST inclusive)
  61.    .detail : View all variations & prices (student prices, 10% markup, GST inclusive)
  62.    .public : View all variation prices for non-students (20% markup, GST inclusive)"""
  63.  
  64.     def data(basePrice):
  65.  
  66.         """Data entry prices arranged as provided order.
  67.        Data entry prices are student prices (10% markup, GST inclusive)
  68.        basePrice : GST exclusive, no markup price."""
  69.        
  70.         basePrice = int(basePrice) * 1.1
  71.  
  72.         print('Arrange attributes as ram > ssd\n')
  73.        
  74.         for r in ram.values():
  75.             for s in ssd.values():
  76.                 for m in mon23.values():
  77.                     item = round((basePrice + m + r + s)*1.15, 3)
  78.                     print(str(round(item, 3)))
  79.  
  80.         print("\nCount : 12")
  81.  
  82.     def detail(basePrice):
  83.  
  84.         """Variation details in student prices (10% markup, GST inclusive)
  85.        basePrice : GST exclusive, no markup price."""
  86.  
  87.         basePrice = int(basePrice) * 1.1
  88.  
  89.         print("Variation details in student prices (10% markup, GST inclusive)\n")
  90.        
  91.         for rk in ram.keys():
  92.             for sk in ssd.keys():
  93.                 for mk in mon23.keys():
  94.                     item = round((basePrice + ram[rk] + ssd[sk] + mon23[mk])*1.15, 3)
  95.                     print(rk + sk + mk + str(item))
  96.  
  97.         print("Count : 12")
  98.  
  99.     def public(basePrice):
  100.  
  101.         """Variation details in non-student prices (10% markup, GST inclusive)
  102.        basePrice : GST exclusive, no markup price."""
  103.  
  104.         basePrice = int(basePrice) * 1.1
  105.  
  106.         print("Variation details in student prices (10% markup, GST inclusive)\n")
  107.        
  108.         for rk in ram.keys():
  109.             for sk in ssd.keys():
  110.                 for mk in mon23.keys():
  111.                     item = round((basePrice + ram[rk] + ssd[sk] + mon23[mk])*1.15*1.1, 3)
  112.                     print(rk + sk + mk + str(item))
  113.  
  114.         print("Count : 12")
  115.  
  116. class ptllp:
  117.  
  118.     """Laptops provided by PTL Computers.
  119.    .data : Data entry prices (student prices, 10% markup, GST inclusive)
  120.    .detail : View all variations & prices (student prices, 10% markup, GST inclusive)
  121.    .public : View all variation prices for non-students (20% markup, GST inclusive)"""
  122.  
  123.     def data(basePrice):
  124.  
  125.         """Data entry prices arranged as provided order.
  126.        Data entry prices are student prices (10% markup, GST inclusive)
  127.        basePrice : GST exclusive, no markup price."""
  128.        
  129.         basePrice = int(basePrice) * 1.1
  130.  
  131.         print('Arrange attributes as ram > ssd > warr\n')
  132.        
  133.         for r in ram.values():
  134.             for s in ssd.values():
  135.                 for l in lapbag.values():
  136.                     for w in warranty.values():
  137.                         item = round((basePrice + l + r + s + w)*1.15, 3)
  138.                         print(str(round(item, 3)))
  139.  
  140.         print("\nCount : 24")
  141.  
  142.     def detail(basePrice):
  143.  
  144.         """Variation details in student prices (10% markup, GST inclusive)
  145.        basePrice : GST exclusive, no markup price."""
  146.  
  147.         basePrice = int(basePrice) * 1.1
  148.  
  149.         print("Variation details in student prices (10% markup, GST inclusive)\n")
  150.        
  151.         for rk in ram.keys():
  152.             for sk in ssd.keys():
  153.                 for lk in lapbag.keys():
  154.                     for wk in warranty.keys():
  155.                         item = round((basePrice + ram[rk] + ssd[sk] + lapbag[lk] + warranty[wk])*1.15, 3)
  156.                         print(rk + sk + lk + wk + str(item))
  157.  
  158.         print("Count : 24")
  159.  
  160.     def public(basePrice):
  161.  
  162.         """Variation details in non-student prices (20% markup, GST inclusive)
  163.        basePrice : GST exclusive, no markup price."""
  164.  
  165.         basePrice = int(basePrice) * 1.1
  166.  
  167.         print("Variation details in student prices (10% markup, GST inclusive)\n")
  168.        
  169.         for rk in ram.keys():
  170.             for sk in ssd.keys():
  171.                 for lk in lapbag.keys():
  172.                     for wk in warranty.keys():
  173.                         item = round((basePrice + ram[rk] + ssd[sk] + lapbag[lk] + warranty[wk])*1.15*1.1, 3)
  174.                         print(rk + sk + lk + wk + str(item))
  175.  
  176.         print("Count : 24")
  177.  
  178. class ptlpc:
  179.  
  180.     """Desktop PCs provided by PTL Computers.
  181.    .data : Data entry prices (student prices, 10% markup, GST inclusive)
  182.    .detail : View all variations & prices (student prices, 10% markup, GST inclusive)
  183.    .public : View all variation prices for non-students (20% markup, GST inclusive)"""
  184.  
  185.     def data(basePrice):
  186.  
  187.         """Data entry prices arranged as provided order.
  188.        Data entry prices are student prices (10% markup, GST inclusive)
  189.        basePrice : GST exclusive, no markup price."""
  190.        
  191.         basePrice = int(basePrice) * 1.1
  192.  
  193.         print('Arrange attributes as ram > ssd > lapbag > warr\n')
  194.        
  195.         for r in ram.values():
  196.             for s in ssd.values():
  197.                 for w in warranty.values():
  198.                     item = round((basePrice + r + s + w)*1.15, 3)
  199.                     print(str(round(item, 3)))
  200.  
  201.         print("\nCount : 12")
  202.  
  203.     def detail(basePrice):
  204.  
  205.         """Variation details in student prices (10% markup, GST inclusive)
  206.        basePrice : GST exclusive, no markup price."""
  207.  
  208.         basePrice = int(basePrice) * 1.1
  209.  
  210.         print("Variation details in student prices (10% markup, GST inclusive)\n")
  211.        
  212.         for rk in ram.keys():
  213.             for sk in ssd.keys():
  214.                 for wk in warranty.keys():
  215.                     item = round((basePrice + ram[rk] + ssd[sk] + warranty[wk])*1.15, 3)
  216.                     print(rk + sk + wk + str(item))
  217.  
  218.         print("Count : 12")
  219.  
  220.     def public(basePrice):
  221.  
  222.         """Variation details in non-student prices (20% markup, GST inclusive)
  223.        basePrice : GST exclusive, no markup price."""
  224.  
  225.         basePrice = int(basePrice) * 1.1
  226.  
  227.         print("Variation details in student prices (10% markup, GST inclusive)\n")
  228.        
  229.         for rk in ram.keys():
  230.             for sk in ssd.keys():
  231.                 for wk in warranty.keys():
  232.                     item = round((basePrice + ram[rk] + ssd[sk] + warranty[wk])*1.15*1.1, 3)
  233.                     print(rk + sk + wk + str(item))
  234.  
  235.         print("Count : 12")
  236.  
  237. mon23 = {"No monitor\t": 0, "Incl monitor\t": 70}
  238. lapbag = {"No laptop bag\t": 0, "Incl laptop bag\t": 9}
  239. ram = {"No RAM \t\t": 0, "Add 4GB RAM\t": 39, "Add 8GB RAM\t": 79}
  240. ssd = {"No SSD\t\t": 0, "Add SSD\t\t": 99}
  241. warranty = {"No warranty\t": 0, "Incl warranty\t": 99}
  242.  
  243. help = """Use this script as a price checker.
  244.  
  245. Classes
  246. ptlpc :\t\t Desktop PCs sold by PTL
  247. ptllp :\t\t Laptops sold by PTL
  248. dglpc :\t\t Desktop PCs sold by --
  249. dgllp :\t\t Laptops sold by --
  250.  
  251. Functions
  252. .data :\t\t Data entry prices (student prices, 10% markup, GST inclusive)
  253. .detail :\t View all variations & prices (student prices, 10% markup, GST inclusive)
  254. .public :\t View all variation prices for non-students (20% markup, GST inclusive)
  255.  
  256. You can view this any time by typing 'print(help)'.
  257. Note: This is case sensitive"""
  258.  
  259. print(help)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement