Advertisement
Guest User

list

a guest
Oct 28th, 2015
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.39 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>
  98. <span class="label">
  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.  
  226. <!-- edit qty start 2 -->
  227.  
  228. <td>
  229. <?php echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($products)->getQty(); ?>
  230. <input type="text" id="qty_<?php echo $product_id;?>" name="qty" value="<?php echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($products)->getQty(); ?>" style="display:none"/>
  231. <span class="label wk_action">
  232. <img onclick="updateField('<?php echo $product_id; ?>');return false;" src="<?php echo $this->getSkinUrl('marketplace/images/icon-edit.png'); ?>"/>
  233. </span>
  234.  
  235. <br/>
  236.  
  237. <button class="button wk_mp_btn1" title="<?php echo $helper->__('Save') ?>" type="submit" id="save_butn">
  238. <span><span style="font-size:12px;"><?php echo $helper->__('Update') ?></span></span>
  239. </button>
  240. <button type="reset" class="cancel" onclick="updateField('<?php echo $product_id; ?>');return false;">
  241. <span><span><?php echo $helper->__('Cancel') ?></span></span>
  242. </button>
  243. </td>
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251. <!-- edit qty end 2 -->
  252.  
  253.  
  254.  
  255. <!--
  256. <td>
  257. <span class="label qty">
  258. <?php echo $salesdetail['quantitysoldconfirmed']; ?>
  259. </span>
  260. </td>
  261. <td>
  262. <span class="label qty">
  263. <?php echo $salesdetail['quantitysoldpending']; ?>
  264. </span>
  265. </td>
  266. <td>
  267. <span class="label qty">
  268. <a href="<?php echo $this->getUrl('mpshippingmanager/shipping/salesdetail/')."id/".$products->getId(); ?>"><?php echo $salesdetail['quantitysold']; ?></a>
  269. </span>
  270. </td>
  271. -->
  272. <td>
  273. <span class="label price">
  274. <?php echo Mage::helper('core')->currency($salesdetail['amountearned'], true, false); ?>
  275. </span>
  276. </td>
  277. <?php
  278. }?>
  279. <td>
  280. <span class="label wk_action">
  281. <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"/>
  282. <img src="<?php echo $this->getSkinUrl('marketplace/images/icon-trash.png'); ?>" alt="<?php echo $helper->__('Delete')?>" title="<?php echo $helper->__('Delete')?>" class="mp_delete"/>
  283. </span>
  284. </td>
  285. </tr>
  286. <?php
  287. }?>
  288. </tbody>
  289. </table>
  290. </form>
  291. <?php
  292. }?>
  293. </div>
  294. </div>
  295. <?php echo $this->getPagerHtml(); ?>
  296. </div>
  297. <div class="buttons-set">
  298. <p class="back-link">
  299. <a href="javascript:;" onclick="javascript: window.history.back();" class="left">&laquo; <?php echo $helper->__('Back') ?></a>
  300. </p>
  301. </div>
  302. </div>
  303.  
  304.  
  305.  
  306. <!-- edit qty start 2-->
  307.  
  308. <?php $url = Mage::getUrl('module_name/index/updateField/'); ?>
  309. <?php $url = Mage::getUrl('marketplaceaccountcontroller/index/updateField/'); ?>
  310.  
  311. <script type = "text/javascript" >
  312.  
  313. var $wk_jq = jQuery.noConflict();
  314.  
  315. function updateField(product_id)
  316. {
  317. var qtyId = '#qty_'+product_id;
  318.  
  319. $wk_jq(qtyId).toggle()
  320.  
  321. $qty = $wk_jq(qtyId).val();
  322.  
  323. new Ajax.Request('<?php echo $url ?>', {
  324. method: 'post',
  325. parameters: {id: product_id, qty: $qty}
  326. });
  327. }
  328. </script>
  329.  
  330.  
  331. <!-- edit qty end 2-->
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340. <script>
  341. var $wk_jq=jQuery.noConflict();
  342. var newCustomerProductForm1 = new VarienForm('formmassdelete', true);
  343. (function($wk_jq){
  344. $wk_jq( "#special_from_date" ).datepicker({dateFormat: "yy-mm-dd"});
  345. $wk_jq( "#special_to_date" ).datepicker({dateFormat: "yy-mm-dd"});
  346. $wk_jq('body').delegate('.mp_edit','click',function(){
  347. var id=$wk_jq(this).parents('.wk_row_view').find('.hidden_id').val();
  348. var dicision=confirm('<?php echo $helper->__(" Are you sure you want to edit this product ? ")?>');
  349. if(dicision==true){
  350. var $type_id=$wk_jq(this).attr('data-type');
  351. if($type_id=='simple')
  352. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapprovedsimple/') ?>".concat("id/",id);
  353. if($type_id=='downloadable')
  354. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapproveddownloadable/') ?>".concat("id/",id);
  355. if($type_id=='virtual')
  356. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapprovedvirtual/') ?>".concat("id/",id);
  357. if($type_id=='configurable')
  358. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/editapprovedconfigurable/') ?>".concat("id/",id);
  359. if($type_id=='grouped')
  360. window.location = "<?php echo $this->getUrl('mpgroupproduct/index/editapprovedgrouped/') ?>".concat("id/",id);
  361. <?php
  362. //echo $this->getChildHtml('mpgrouped_productslist');
  363. // echo $this->getChildHtml('mpbundle_productslist');
  364. ?>
  365. if($type_id=='bundle')
  366. window.location = "<?php echo $this->getUrl('mpbundleproduct/index/editbundle/') ?>".concat("id/",id);
  367. }
  368. });
  369. $wk_jq('#mass_delete_butn').click(function(e){
  370. var flag =0;
  371. $wk_jq('.mpcheckbox').each(function(){
  372. if (this.checked == true){
  373. flag =1;
  374. }
  375. });
  376. if (flag == 0){
  377. alert("<?php echo $helper->__(' No Checkbox is checked ') ?>");
  378. return false;
  379. }
  380. else{
  381. var dicisionapp=confirm('<?php echo $helper->__(" Are you sure you want to delete these product ? ")?>');
  382. if(dicisionapp==true){
  383. $wk_jq('#form-customer-product-new').submit();
  384. }else{
  385. return false;
  386. }
  387. }
  388. });
  389.  
  390. $wk_jq('#mpselecctall').click(function(event) {
  391. if(this.checked) {
  392. $wk_jq('.mpcheckbox').each(function() {
  393. this.checked = true;
  394. });
  395. }else{
  396. $wk_jq('.mpcheckbox').each(function() {
  397. this.checked = false;
  398. });
  399. }
  400. });
  401.  
  402. $wk_jq('.mp_delete').click(function(){
  403. var id=$wk_jq(this).parents('.wk_row_view').find('.hidden_id').val();
  404. var dicisionapp=confirm('<?php echo $helper->__(" Are you sure you want to delete this product ? ")?>');
  405. if(dicisionapp==true)
  406. window.location = "<?php echo $this->getUrl('marketplace/marketplaceaccount/delete/') ?>".concat("id/",id);
  407. });
  408. })($wk_jq);
  409. </script>
  410.  
  411.  
  412. <script>
  413. var $wk_jq=jQuery.noConflict();
  414. var i=2;
  415. function showOtherImage(){
  416. var newdiv = document.createElement('div');
  417. newdiv.setAttribute("id","childDiv"+i);
  418. newdiv.innerHTML = "<input type='file' name='images"+i+"' accept='image/\*' class='wk_imagevalidate'/><input type='radio' onClick='defaultimagevalue(this)' value='' class='defaultimage' name='defaultimage'><span class='defaultimageset'>Base image</span><a href=\"javascript:;\" onclick=\"removeEvent('childDiv"+i+"')\"><?php echo $helper->__('Remove ') ?></a>";
  419. var ni = document.getElementById('otherimages');
  420. ni.appendChild(newdiv);
  421. i++;
  422. }
  423. function removeEvent(divNum){
  424. var d = document.getElementById('otherimages');
  425. var olddiv = document.getElementById(divNum);
  426. d.removeChild(olddiv);
  427. i--;
  428. }
  429. function defaultimagevalue(object){
  430. var strs=$wk_jq(object).prev('input').val().split('\\');
  431. $wk_jq(object).val(strs[strs.length-1]);
  432. }
  433. (function($wk_jq){
  434. var newCustomerProductForm = new VarienForm('form-customer-product-editPost', true);
  435. $wk_jq( "#special_from_date" ).datepicker({'dateFormat':'yy:mm:dd'});
  436. $wk_jq( "#special_to_date" ).datepicker({'dateFormat':'yy:mm:dd'});
  437.  
  438. $wk_jq('.wk_close').click(function(){
  439. $wk_jq(this).parent().remove();
  440. });
  441.  
  442. $wk_jq('#save_butn').click(function(e){
  443. if(newCustomerProductForm.validator.validate()!=false){
  444. var descrip = nicEditors.findEditor( "description" ).getContent();
  445. var sdescrip = nicEditors.findEditor( "short_description" ).getContent();
  446. //var regex = /(&lt([^>]+)&gt)/ig;
  447. var regex = /<script(.+?)<\/script>/g;
  448. var result = descrip .replace(regex, "");
  449. result = result.replace(/script/g,'');
  450. nicEditors.findEditor( "description" ).setContent(result);
  451.  
  452. var sresult = sdescrip .replace(regex, "");
  453. sresult = sresult.replace(/script/g,'');
  454. nicEditors.findEditor( "short_description" ).setContent(sresult);
  455.  
  456. $wk_jq('#description').text(result);
  457. $wk_jq('#short_description').text(sresult);
  458.  
  459. $wk_jq('#save_butn span span').text('<?php echo $helper->__(" Saving..")?>');
  460. $wk_jq('.button').css('opacity','0.7');
  461. $wk_jq('.button').css('cursor','default');
  462. $wk_jq('.button').attr('disabled','disabled');
  463. $wk_jq('#form-customer-product-editPost').submit();
  464. }
  465. });
  466.  
  467. $wk_jq('.input-text').change(function(){
  468. var validt = $wk_jq(this).val();
  469. var regex = /(<([^>]+)>)/ig;
  470. var mainvald = validt .replace(regex, "");
  471. $wk_jq(this).val(mainvald);
  472. });
  473.  
  474. $wk_jq(".dumimg").change(function(){
  475. $wk_jq( ".defaultimage" ).prop( "checked", false );
  476. });
  477. $wk_jq('input#sku').change(function(){
  478. var len=$wk_jq('input#sku').val();
  479. var len2=len.length;
  480. if(len2==0){
  481. alert('<?php echo $helper->__(" SKU can\'t be left empty ")?>');
  482. $wk_jq('div#skuavail').css('display','none');
  483. $wk_jq('div#skunotavail').css('display','none');
  484. }
  485. else{
  486. $wk_jq.ajax({
  487. url: "<?php echo Mage::getUrl('marketplace/marketplaceaccount/verifysku',array('_secure'=>true));?>",
  488. type: "POST",
  489. data: {sku:$wk_jq('input#sku').val()},
  490. dataType: 'html',
  491. success:function($data){
  492. $data=JSON.parse($data);
  493. if($data.avl==1){
  494. $wk_jq('div#skuavail').css('display','block');
  495. $wk_jq('div#skunotavail').css('display','none');
  496. }
  497. else{
  498. $wk_jq('div#skunotavail').css('display','block');
  499. $wk_jq('div#skuavail').css('display','none');
  500. $wk_jq("input#sku").attr('value','');
  501. }
  502. }
  503. });
  504. }
  505. });
  506.  
  507. $wk_jq("body").delegate('.wk_imagevalidate',"change",function(){
  508. var ext = $wk_jq(this).val().split('.').pop().toLowerCase();
  509. if($wk_jq.inArray(ext, ['gif','png','jpg','jpeg']) == -1) {
  510. $wk_jq(this).val('');
  511. alert('<?php echo $helper->__(" invalid extension! Please Upload an image ")?>');
  512. }
  513. });
  514.  
  515. $wk_jq("#wk_bodymain").delegate('.wk_plus ,.wk_plusend,.wk_minus, .wk_minusend ',"click",function(){
  516. var thisthis=$wk_jq(this);
  517. if(thisthis.hasClass("wk_plus") || thisthis.hasClass("wk_plusend")){
  518. if(thisthis.hasClass("wk_plus"))
  519. thisthis.removeClass('wk_plus').addClass('wk_plus_click');
  520. if(thisthis.hasClass("wk_plusend"))
  521. thisthis.removeClass('wk_plusend').addClass('wk_plusend_click');
  522. thisthis.prepend("<span class='wk_node_loader'></span>");
  523.  
  524. $wk_jq.ajax({
  525. url : "<?php echo $this->getUrl('marketplace/marketplaceaccount/categorytree/',array('_secure'=>true));?>",
  526. type : "POST",
  527. data : {CID:thisthis.siblings("input").val(),
  528. ML:thisthis.parent(".wk_cat_container").css("margin-left").replace("px",""),
  529. CATS : "<?php echo implode(',',$categories); ?>"},
  530. dataType: "html",
  531. success : function(content){
  532. var newdata= $wk_jq.parseJSON(content);
  533. len= newdata.length;
  534. var pxl= parseInt(thisthis.parent(".wk_cat_container").css("margin-left").replace("px",""))+20;
  535. thisthis.find(".wk_node_loader").remove();
  536. if(thisthis.attr("class") == "wk_plus")
  537. thisthis.attr("class","wk_minus");
  538. if(thisthis.attr("class") == "wk_plusend")
  539. thisthis.attr("class","wk_minusend");
  540. if(thisthis.attr("class") == "wk_plus_click")
  541. thisthis.attr("class","wk_minus");
  542. if(thisthis.attr("class") == "wk_plusend_click")
  543. thisthis.attr("class","wk_minusend");
  544. for(i=0;i<len; i++){
  545. id=newdata[i].id;
  546. checkn=newdata[i].check;
  547. nam=newdata[i].name;
  548. if(checkn==1){
  549. if(newdata[i].counting ==0){
  550. thisthis.parent(".wk_cat_container").after('<div class="wk_removable wk_cat_container" style="display:none;margin-left:'+pxl+'px;"><span class="wk_no"></span><span class="wk_foldersign"></span><span class="wk_elements wk_cat_name">'+ nam +'</span><input class="wk_elements" type="checkbox" checked name="category[]" value='+ id+' </div>');
  551. }else{
  552. thisthis.parent(".wk_cat_container").after('<div class="wk_removable wk_cat_container" style="display:none;margin-left:'+pxl+'px;"><span class="wk_plusend"></span><span class="wk_foldersign"></span><span class="wk_elements wk_cat_name">'+ nam +'</span><input class="wk_elements" type="checkbox" checked name="category[]" value='+ id +'></div>');
  553. }
  554. }else{
  555. if(newdata[i].counting ==0){
  556. thisthis.parent(".wk_cat_container").after('<div class="wk_removable wk_cat_container" style="display:none;margin-left:'+pxl+'px;"><span class="wk_no"></span><span class="wk_foldersign"></span><span class="wk_elements wk_cat_name">'+ nam +'</span><input class="wk_elements" type="checkbox" name="category[]" value='+ id+'></div>');
  557. }else{
  558. thisthis.parent(".wk_cat_container").after('<div class="wk_removable wk_cat_container" style="display:none;margin-left:'+pxl+'px;"><span class="wk_plusend"></span><span class="wk_foldersign"></span><span class="wk_elements wk_cat_name">'+ nam +'</span><input class="wk_elements" type="checkbox" name="category[]" value='+ id +'></div>');
  559. }
  560. }
  561. }
  562. thisthis.parent(".wk_cat_container").nextAll().slideDown(300);
  563. }
  564. });
  565. }
  566. if(thisthis.hasClass("wk_minus") || thisthis.hasClass("wk_minusend")){
  567. if(thisthis.attr("class") == "wk_minus")
  568. thisthis.attr("class","wk_plus");
  569. if(thisthis.attr("class") == "wk_minusend")
  570. thisthis.attr("class","wk_plusend");
  571. var thiscategory = thisthis.parent(".wk_cat_container");
  572. var marg= parseInt(thiscategory.css("margin-left").replace("px",""));
  573. while(thiscategory.next().hasClass("wk_removable")){
  574.  
  575. if(parseInt(thiscategory.next().css("margin-left").replace("px",""))>marg)
  576. thiscategory.next().slideUp("slow",function(){$wk_jq(this).remove();});
  577. thiscategory = thiscategory.next();
  578. if(typeof thiscategory.next().css("margin-left")!= "undefined"){
  579. if( marg==thiscategory.next().css("margin-left").replace("px",""))
  580. {
  581. break;
  582. }
  583. }
  584. }
  585. }
  586. });
  587.  
  588. $wk_jq("body").delegate('.nicEdit-main',"blur",function(){
  589. var x = $wk_jq(this).text()
  590. $wk_jq(this).parent().parent().children('textarea').text(x);
  591. });
  592.  
  593. $wk_jq('.image_set span').click(function(event){
  594. var dicisionapp=confirm('<?php echo $helper->__(" Are you sure you want to delete this image ? ")?>');
  595. if(dicisionapp==true){
  596. var deleteflag=0;
  597. var thisthis = $wk_jq(this);
  598. var imag = thisthis.prev('img').attr('id');
  599. thisthis.html("<img src='<?php echo $this->getSkinUrl('marketplace/images/loading.gif'); ?>'/>");
  600. thisthis.removeClass('wk_imagedelete');
  601. thisthis.addClass('wk_imagedeleteload');
  602. $wk_jq.ajax({
  603. url: "<?php echo $this->getUrl('marketplace/marketplaceaccount/deleteimage',array('_secure'=>true));?>",
  604. type: "POST",
  605. data: {file:thisthis.prev('img').attr('id'),pid:thisthis.prev('img').attr('pid')},
  606. dataType: 'html',
  607. success:function(content){
  608. thisthis.parent('div.setimage').remove();
  609. }
  610. });
  611. }
  612. });
  613. $wk_jq('.wk_imagedelete img').mouseover(function(event){
  614. $wk_jq(event.target).css('width','22px');
  615. });
  616. $wk_jq('.wk_imagedelete img').mouseout(function(event){
  617. $wk_jq(event.target).css('width','20px');
  618. });
  619. })($wk_jq);
  620. </script>
  621.  
  622.  
  623.  
  624.  
  625.  
  626. <?php
  627. }else{
  628. echo "<h2 class='wk_new_msg'>".$helper->__("To BECOME SELLER PLEASE CONTACT TO ADMIN.")."</h2>";
  629. }?>
  630.  
  631.  
  632.  
  633.  
  634. <style>
  635.  
  636. .wk_mp_btn1 {background: #3fbdf7 none repeat scroll 0 0;color: #fff;}
  637.  
  638.  
  639. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement