Advertisement
Guest User

ship 1

a guest
Oct 27th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.69 KB | None | 0 0
  1. <?php
  2. $isPartner= Mage::getModel('marketplace/userprofile')->isPartner();
  3. $helper= Mage::helper('marketplace');
  4. if($isPartner==1){
  5. ?>
  6. <script type="text/javascript">
  7. if (typeof jQuery == 'undefined'){
  8. document.write(unescape("%3Cscript src='//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
  9. }
  10. </script>
  11. <script src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  12. <link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  13. <div class="page-title">
  14. <h1 style="float:left;"><?php echo $helper->__('My Product List') ?></h1>
  15. </div>
  16. <div class="wk_mp_design">
  17. <div class="block block-account">
  18. <div class="block-title">
  19. <strong><span><h4><?php echo $helper->__('Product List') ?></h4></span></strong>
  20. </div>
  21. </div>
  22. <div class="fieldset wk_mp_fieldset">
  23. <div class="grid">
  24. <div class="hor-scroll">
  25. <form action="<?php echo Mage::helper('core/url')->getCurrentUrl();?>" method="post">
  26. <table cellspacing="0" class="border wk_mp_list_table">
  27. <thead>
  28. <tr id="wk_mp_tr_heading">
  29. <th><span><?php echo $helper->__('Product Name') ?></span></th>
  30. <th><span><?php echo $helper->__('Date') ?></span></th>
  31. <th><span><?php echo $helper->__('Product Status') ?></span></th>
  32. <th><span>&nbsp;</span></th>
  33. </tr>
  34. </thead>
  35. <tbody class="wk_mp_body">
  36. <tr>
  37. <td>
  38. <input type="text" class="input-text" name="s" placeholder='<?php echo $helper->__('Search by product name') ?>' value="<?php echo $this->getRequest()->getParam('s')?>"/>
  39. </td>
  40. <td>
  41. <span class="wk_mp_td_span">
  42. <?php echo $helper->__('From: ') ?>
  43. <input name="from_date" id="special_from_date" class="input-text" value="<?php echo $this->getRequest()->getParam('from_date')?>" />
  44. </span>
  45. <span class="wk_mp_td_span">
  46. <?php echo $helper->__('To: ') ?>
  47. <input name="to_date" id="special_to_date" class="input-text" value="<?php echo $this->getRequest()->getParam('to_date')?>" />
  48. </span>
  49. </td>
  50. <td>
  51. <select name="prostatus" class="input-text">
  52. <option value=""><?php echo $helper->__('All') ?></option>
  53. <option value="1" <?php if($this->getRequest()->getParam('prostatus') == 1) echo 'selected="selected"'?>>
  54. <?php echo $helper->__('Approved') ?>
  55. </option>
  56. <option value="2" <?php if($this->getRequest()->getParam('prostatus') == 2) echo 'selected="selected"'?>>
  57. <?php echo $helper->__('Unapproved') ?>
  58. </option>
  59. </select>
  60. </td>
  61. <td>
  62. <button class="button" title="Save" type="submit">
  63. <span><span><span><?php echo $helper->__('Submit') ?></span></span></span>
  64. </button>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </form>
  70. <?php
  71. if(count($this->getCollection())==0){ ?>
  72. <div class="fieldset wk_mp_fieldset">
  73. <div class="wk_emptymsg">
  74. <?php echo $helper->__('No Product Available') ?>
  75. </div>
  76. </div>
  77. <?php
  78. } else{ ?>
  79. <form action="<?php echo $this->getUrl('marketplace/marketplaceaccount/massdeletesellerpro') ?>" method="post" id="formmassdelete" name="formmassdelete">
  80. <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
  81. <button class="button" title="<?php echo $helper->__('Delete Products') ?>" type="submit" style="float: left;padding: 5px 5px 5px 0;" id="mass_delete_butn">
  82. <span><span><?php echo $helper->__('Delete Products') ?></span></span>
  83. </button>
  84. <table cellspacing="0" class="border wk_mp_list_table wk_mp_list_container_table">
  85. <thead>
  86. <tr class="wk_content">
  87. <th class="wk_check_first_td">
  88. <span>
  89. <input type="checkbox" name="mpselecctall" value="all" id="mpselecctall"/>
  90. </span>
  91. </th>
  92. <th class="wk_first_td">
  93. <span class="label name">
  94. <?php echo $helper->__('Product')?>
  95. </span>
  96. </th>
  97. <th class="wk_first_td">
  98. <span class="label name">
  99. <?php echo $helper->__('sku')?>
  100. </span>
  101. </th>
  102. <th>
  103. <span class="label pro_status">
  104. <?php echo $helper->__('Status')?>
  105. </span>
  106. </th>
  107.  
  108. <!--
  109. <th>
  110. <span class="label qty">
  111. <?php echo $helper->__('Qty. Confirmed')?>
  112. </span>
  113. </th>
  114. <th>
  115. <span class="label qty">
  116. <?php echo $helper->__('Qty. Pending')?>
  117. </span>
  118. </th>
  119. <th>
  120. <span class="label qty">
  121. <?php echo $helper->__('Qty. Sold')?>
  122. </span>
  123. </th>
  124. -->
  125. <th>
  126. <span class="label">
  127. <?php echo $helper->__('Qty')?>
  128. </span>
  129. </th>
  130.  
  131. <th>
  132. <span class="label">
  133. <?php echo $helper->__('Earn Amount')?>
  134. </span>
  135. </th>
  136. <th>
  137. <span class="label">
  138. <?php echo $helper->__('Action')?>
  139. </span>
  140. </th>
  141. </tr>
  142. </thead>
  143. <tbody>
  144. <?php
  145. $i = 0;
  146. foreach($this->getCollection() as $products){
  147. $i++;
  148. $productMediaConfig = Mage::getModel('catalog/product_media_config');
  149. $salesdetail=Mage::getModel('marketplace/saleslist')->getSalesdetail($products->getEntityId());
  150. ?>
  151. <tr class="wk_row_view <?php echo $class = ($i == count($this->getCollection()))? 'wk_last_tr':''?>">
  152. <td class="wk_check_first_td">
  153. <span>
  154. <input type="checkbox" name="product_mass_delete[]" class="mpcheckbox" value="<?php echo $products->getEntityId(); ?>"/>
  155. </span>
  156. </td>
  157. <td class="wk_first_td">
  158. <input type="hidden" class="hidden_id" value="<?php echo $products->getEntityId(); ?>" />
  159. <div class="label name" title="<?php echo $products->getName(); ?>">
  160. <div class="wk_pro_divide1">
  161. <img src="<?php echo Mage::helper('catalog/image')->init($products,'thumbnail');?>" class="image" />
  162. </div>
  163. <div class="wk_pro_divide2">
  164. <div style="width:100%;">
  165. <a href="<?php echo $this->getUrl($products->getUrlPath())?>" target="blank">
  166. <?php echo $products->getName();?>
  167. </a>
  168. </div>
  169. <div style="width:100%;float:left;">
  170. <?php echo Mage::helper('core')->currency($products->getPrice(), true, false);?>
  171. </div>
  172. </div>
  173. </div>
  174. </td>
  175.  
  176. <td>
  177. <?php echo $sku = Mage::getModel('catalog/product')->load($products->getId())->getSku();?>
  178. </td>
  179.  
  180.  
  181. <?php
  182. if($products->getStatus()==2) { ?>
  183. <td>
  184. <span class="label pro_status">
  185. <?php echo $helper->__('Pending')?>
  186. </span>
  187. </td>
  188. <td>
  189. <span class="label qty">
  190. <?php echo $helper->__('Pending')?>
  191. </span>
  192. </td>
  193. <td>
  194. <span class="label qty">
  195. <?php echo $helper->__('Pending')?>
  196. </span>
  197. </td>
  198. <td>
  199. <span class="label qty">
  200. <?php echo $helper->__('Pending')?>
  201. </span>
  202. </td>
  203. <td>
  204. <span class="label qty">
  205. <?php echo $helper->__('Pending')?>
  206. </span>
  207. </td>
  208. <?php }
  209. else{
  210. $id=$products->getId();
  211. $productsolddetail=Mage::getModel('marketplace/saleslist')->getProductSalesDetailById($id);
  212. $qtycom=0;
  213. $com=0;
  214. foreach($productsolddetail as $key){
  215. $qtycom+=$key['magequantity'];
  216. $com+=$key['actualparterprocost'];
  217. } ?>
  218.  
  219. <td>
  220. <span class="label pro_status">
  221. <?php echo $helper->__('Approved')?>
  222. </span>
  223. </td>
  224.  
  225. <!-- edit qty -->
  226. <td>
  227.  
  228. <?php echo (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($products)->getQty(); ?>
  229.  
  230. <span class="label wk_action">
  231. <img onclick="updateField(this, '. $product_id .'); return false"; src="<?php echo $this->getSkinUrl('marketplace/images/icon-edit.png'); ?>"
  232.  
  233.  
  234. />
  235.  
  236. </span>
  237. </td>
  238.  
  239. <!-- edit qty end -->
  240.  
  241.  
  242. <!--
  243. <td>
  244. <span class="label qty">
  245. <?php echo $salesdetail['quantitysoldconfirmed']; ?>
  246. </span>
  247. </td>
  248. <td>
  249. <span class="label qty">
  250. <?php echo $salesdetail['quantitysoldpending']; ?>
  251. </span>
  252. </td>
  253. <td>
  254. <span class="label qty">
  255. <a href="<?php echo $this->getUrl('mpshippingmanager/shipping/salesdetail/')."id/".$products->getId(); ?>"><?php echo $salesdetail['quantitysold']; ?></a>
  256. </span>
  257. </td>
  258. -->
  259. <td>
  260. <span class="label price">
  261. <?php echo Mage::helper('core')->currency($salesdetail['amountearned'], true, false); ?>
  262. </span>
  263. </td>
  264. <?php
  265. }?>
  266. <td>
  267. <span class="label wk_action">
  268. <img src="<?php echo $this->getSkinUrl('marketplace/images/icon-edit.png'); ?>" data-type="<?php echo $products->getTypeId(); ?>" alt="<?php echo $helper->__('Edit')?>" title="<?php echo $helper->__('Edit')?>" class="mp_edit"/>
  269. <img src="<?php echo $this->getSkinUrl('marketplace/images/icon-trash.png'); ?>" alt="<?php echo $helper->__('Delete')?>" title="<?php echo $helper->__('Delete')?>" class="mp_delete"/>
  270. </span>
  271. </td>
  272. </tr>
  273. <?php
  274. }?>
  275. </tbody>
  276. </table>
  277. </form>
  278. <?php
  279. }?>
  280. </div>
  281. </div>
  282. <?php echo $this->getPagerHtml(); ?>
  283. </div>
  284. <div class="buttons-set">
  285. <p class="back-link">
  286. <a href="javascript:;" onclick="javascript: window.history.back();" class="left">&laquo; <?php echo $helper->__('Back') ?></a>
  287. </p>
  288. </div>
  289. </div>
  290.  
  291. <!-- edit qty -->
  292. <?php $url = Mage::getUrl('module_name/index/updateField/'); ?>
  293.  
  294. <script>
  295.  
  296. <script type="text/javascript">
  297.  
  298. function updateField(image, product_id)
  299. {
  300. new Ajax.Request('<?php echo $url ?>', {
  301. method: 'post',
  302. parameters: { id: fieldId, field: $(button).previous('input').getValue() }
  303. });
  304. }
  305. </script>
  306.  
  307.  
  308. <!-- edit qty -->
  309.  
  310.  
  311. <script>
  312. var $wk_jq=jQuery.noConflict();
  313. var newCustomerProductForm1 = new VarienForm('formmassdelete', true);
  314. (function($wk_jq){
  315. $wk_jq( "#special_from_date" ).datepicker({dateFormat: "yy-mm-dd"});
  316. $wk_jq( "#special_to_date" ).datepicker({dateFormat: "yy-mm-dd"});
  317. $wk_jq('body').delegate('.mp_edit','click',function(){
  318. var id=$wk_jq(this).parents('.wk_row_view').find('.hidden_id').val();
  319. var dicision=confirm('<?php echo $helper->__(" Are you sure you want to edit this product ? ")?>');
  320. if(dicision==true){
  321. var $type_id=$wk_jq(this).attr('data-type');
  322. if($type_id=='simple')
  323. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapprovedsimple/') ?>".concat("id/",id);
  324. if($type_id=='downloadable')
  325. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapproveddownloadable/') ?>".concat("id/",id);
  326. if($type_id=='virtual')
  327. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapprovedvirtual/') ?>".concat("id/",id);
  328. if($type_id=='configurable')
  329. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapprovedconfigurable/') ?>".concat("id/",id);
  330. if($type_id=='grouped')
  331. window.location = "<?php echo $this->getUrl('mpgroupproduct/index/editapprovedgrouped/') ?>".concat("id/",id);
  332. <?php
  333. //echo $this->getChildHtml('mpgrouped_productslist');
  334. // echo $this->getChildHtml('mpbundle_productslist');
  335. ?>
  336. if($type_id=='bundle')
  337. window.location = "<?php echo $this->getUrl('mpbundleproduct/index/editbundle/') ?>".concat("id/",id);
  338. }
  339. });
  340. $wk_jq('#mass_delete_butn').click(function(e){
  341. var flag =0;
  342. $wk_jq('.mpcheckbox').each(function(){
  343. if (this.checked == true){
  344. flag =1;
  345. }
  346. });
  347. if (flag == 0){
  348. alert("<?php echo $helper->__(' No Checkbox is checked ') ?>");
  349. return false;
  350. }
  351. else{
  352. var dicisionapp=confirm('<?php echo $helper->__(" Are you sure you want to delete these product ? ")?>');
  353. if(dicisionapp==true){
  354. $wk_jq('#form-customer-product-new').submit();
  355. }else{
  356. return false;
  357. }
  358. }
  359. });
  360.  
  361. $wk_jq('#mpselecctall').click(function(event) {
  362. if(this.checked) {
  363. $wk_jq('.mpcheckbox').each(function() {
  364. this.checked = true;
  365. });
  366. }else{
  367. $wk_jq('.mpcheckbox').each(function() {
  368. this.checked = false;
  369. });
  370. }
  371. });
  372.  
  373. $wk_jq('.mp_delete').click(function(){
  374. var id=$wk_jq(this).parents('.wk_row_view').find('.hidden_id').val();
  375. var dicisionapp=confirm('<?php echo $helper->__(" Are you sure you want to delete this product ? ")?>');
  376. if(dicisionapp==true)
  377. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/delete/') ?>".concat("id/",id);
  378. });
  379. })($wk_jq);
  380. </script>
  381. <?php
  382. }else{
  383. echo "<h2 class='wk_new_msg'>".$helper->__("To BECOME SELLER PLEASE CONTACT TO ADMIN.")."</h2>";
  384. }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement