有时使用 CMS 可能会让人头疼,您需要进行一些修改,当您完成时,您会收到警报更新可用...您更新您的 CMS...哦,不,您所有的辛勤工作都会得到覆盖,你必须重新开始......
以下代码是我需要处理的代码:我需要根据几个“参数”隐藏此代码的某些部分
所以这里是代码:
<section class="grid-block" id="content">
<div id="system-message-container">
</div>
<div class="redshop" id="redshopcomponent"><form onsubmit="return CheckCardNumber(this);" enctype="multipart/form-data" id="adminForm" name="adminForm" method="post" action="/component/redshop/checkout.html"><div id="divOnestepCheckout"><table width="100%" cellspacing="2" cellpadding="2" border="0">
<tbody>
<tr>
<td>
<fieldset class="adminform">
<legend>Dirección de Facturación</legend>
<a rel="{handler: 'iframe', size: {x: 800, y: 550}}" href="/store/account_billto.html?tmpl=component&for=true&return=checkout&Itemid=1" class="modal"> Editar</a> <br>Nombre : Tardoss<br>Apellidos : Notengo<br>Dirección : Lejos del Prado #32<br> Código postal : 51000<br>Ciudad : Mexico<br> País : Mexico<br>Provincia : México (Estado de)<br>Teléfono : 5565478963<br>E-mail :
<script type="text/javascript">
<!--
var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
var path = 'hr' + 'ef' + '=';
var addy80186 = 't&#97;rd&#111;ss' + '&#64;';
addy80186 = addy80186 + 'h&#111;tm&#97;&#105;l' + '&#46;' + 'c&#111;m';
document.write('<a ' + path + '\'' + prefix + ':' + addy80186 + '\'>');
document.write(addy80186);
document.write('<\/a>');
//-->\n </script><a href="mailto:example@hotmail.com">example@hotmail.com</a><script type="text/javascript">
<!--
document.write('<span style=\'display: none;\'>');
//-->
</script><span style="display: none;">Esta dirección de correo electrónico está siendo protegida contra los robots de spam. Necesita tener JavaScript habilitado para poder verlo.
<script type="text/javascript">
<!--
document.write('</');
document.write('span>');
//-->
</script></span><br>
</fieldset>
</td>
</tr>
<tr>
<td>
<fieldset class="adminform">
<legend>Dirección de envío</legend>
<div><input type="radio" value="2" name="users_info_id" onclick="javascript:onestepCheckoutProcess(this.name,'');">Por defecto (Igual que la de facturación)</div><div><input type="radio" checked="checked" value="3" name="users_info_id" onclick="javascript:onestepCheckoutProcess(this.name,'');">Tardoss Notengos <a rel="{handler: 'iframe', size: {x: 570, y: 470}}" href="/store/addshipping/3.html?tmpl=component&for=true&return=checkout&Itemid=1" class="modal">(Editar)</a> <a title="" href="http://www.forium.mx/index.php?option=c&view=apto&return=checkout&tmpl=coent&task=remove&infoid=3&Itemid=1">(Borrar)</a></div><a rel="{handler: 'iframe', size: {x: 570, y: 470}}" href="/component/redshop/account_shipto/addshipping.html?tmpl=cnt&for=true&return=checkout&Itemid=1&is_company=0" class="modal"> Añadir dirección</a>
</fieldset>
</td>
</tr>
<tr>
<td>
<table border="0">
<tbody>
<tr>
<td><div style="display:none;"><fieldset class="adminform">
<legend><strong>Envase para envío</strong></legend>
<div><input type="radio" value="1" \');'="" onclick="javascript:onestepCheckoutProcess(this.name,\" name="shipping_box_id" id="shipping_box_id1" checked=""><label for="shipping_box_id1">Box1</label><br></div>
</fieldset>
</div></td>
</tr>
<tr>
<td><div id="divShippingRate"><fieldset>
<legend><strong>Métodos de envío</strong></legend>
<div>
<h3>Envios con Bordado</h3>
<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" checked="" value="m8=" name="shipping_rate_id" id="shipping_rate_id_10025_0"><label for="shipping_rate_id_10025_0">De 10 a 15 dias apartir de la autorización</label> ($ 300 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="8cXI " name="shipping_rate_id" id="shipping_rate_id_10025_1"><label for="shipping_rate_id_10025_1">Envio Express de 3 a 5 dias apartir de la prueba de bordado</label> ($ 500 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="LA==" name="shipping_rate_id" id="shipping_rate_id_10025_2"><label for="shipping_rate_id_10025_2">Recojer en la tienda</label></div>
</div>
<h3>Envios sin Bordado</h3>
<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="It4g==" name="shipping_rate_id" id="shipping_rate_id_10040_0"><label for="shipping_rate_id_10040_0">De 5 a 15 Dias</label> ($ 300 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="JA=" name="shipping_rate_id" id="shipping_rate_id_10040_1"><label for="shipping_rate_id_10040_1">Express de 3 a 5 dias</label> ($ 500 )</div>
</div>
</div>
</fieldset>
</div><div style="display:none" id="divShippingRateTemplateId">354</div></td>
</tr>
<tr>
<td><div id="divPaymentMethod"><fieldset class="adminform">
<legend><strong>Método de pago</strong></legend>
<div></div>
<div>
<div><div class="paymentgtwchecked" id="rs_payment_banktransfer"><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'');" checked="" value="rs_payment_banktransfer" id="rs_payment_banktransfer0" name="payment_method_id"><label for="rs_payment_banktransfer0">Forium - Bank Transfer Payment</label></div></div>
<div></div>
<div><div class="" id="rs_payment_paypal"><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'');" value="rs_payment_paypal" id="rs_payment_paypal1" name="payment_method_id"><label for="rs_payment_paypal1">Forium - Paypal Payments</label></div></div>
<div></div>
</div>
</fieldset>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="0">
<tbody>
<tr>
<td><div id="divRedshopCart"><h1>Mi carro</h1>
<div class="category_print"></div>
<div class="category_print"></div><div class="category_print"></div><div class="category_print"></div><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;" class="tdborder">
<thead>
<tr>
<th>Nombre de producto</th>
<th></th>
<th>Precio de producto excluido</th>
<th>Cantidad</th>
<th>Precio total excluido precio</th>
</tr>
</thead>
<tbody>
<!-- -->
<tr class="tdborder">
<td>
<div class="cartproducttitle"><div class="product_name"><a href="/store/15/1/playeras-polo/caballero/playeras-polo-combinadas/p530/P-playera-polo-blanca-cuello-mil-rayas.html?Itemid=1">Playera Polo Blanca Cuello Mil Rayas</a></div></div>
<div class="cartproducttitle">$ 191</div>
<div class="cartattribut"><div class="checkout_attribute_static">Atributo(s):</div><div class="checkout_attribute_title">Posición:</div><div class="checkout_attribute_wrapper"><div class="checkout_attribute_price">B. Frente Derecho</div></div><div class="checkout_attribute_wrapper"><div class="checkout_attribute_price">C. Manga Derecha</div></div><div class="checkout_attribute_wrapper"><div class="checkout_attribute_price">F. Espalda Alta</div></div></div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
</td>
<td><div class="product_image">IMAGE.JPG</div></td>
<td>$ 191</td>
<td><label>70</label></td>
<td>$ 13,370</td>
</tr>
<!-- -->
<tr class="tdborder">
<td>
<div class="cartproducttitle"><div class="product_name"><a href="/component/redshop/88/1/tallas/tm-p530-1/P-m.html?Itemid=1">M</a></div></div>
<div class="cartproducttitle">$ 0</div>
<div class="cartattribut"></div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
</td>
<td><div class="product_image">NOIMAGE.JPG</div></td>
<td>$ 0</td>
<td><label>25</label></td>
<td>$ 0</td>
</tr>
<!-- -->
<tr class="tdborder">
<td>
<div class="cartproducttitle"><div class="product_name"><a href="/component/redshop/89/1/tallas/tg-p530-1/P-g.html?Itemid=1">G</a></div></div>
<div class="cartproducttitle">$ 0</div>
<div class="cartattribut"></div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
</td>
<td><div class="product_image">NOIMAGE.JPG</div></td>
<td>$ 0</td>
<td><label>32</label></td>
<td>$ 0</td>
</tr>
<!-- -->
</tbody>
</table>
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
<tbody>
<tr>
<td width="50%" valign="top">
<table border="0">
<tbody>
<tr>
<td colspan="2" class="cart_customer_note">Observaciones del cliente<br><textarea id="customer_note" name="customer_note"></textarea></td>
</tr>
<tr>
<td colspan="2" class="cart_requisition_number">Su referencia de pedido<br><input value="" id="requisition_number" name="requisition_number">
</td>
</tr>
</tbody>
</table>
<br></td>
<td width="50%" valign="top" align="right"><br><br>
<table width="100%" border="0" class="cart_calculations">
<tbody>
<tr class="tdborder">
<td><b>Producto sin IVA Subtotal</b></td>
<td width="100">$ 13,370</td>
</tr>
<!-- -->
<tr>
<td><b>Envío con IVA</b></td>
<td width="100"><span id="spnShippingrate">$ 300</span></td>
</tr>
<!-- -->
<!-- -->
<tr>
<td>
<div class="singleline"><strong>Total:</strong></div>
</td>
<td width="100">
<div class="singleline"><span id="spnTotal">$ 13,670</span></div>
</td>
</tr>
</tbody>
</table>
<div>Recibir ofertas y otros boletines de noticias. <input type="checkbox" ''="" value="1" name="newsletter_signup"></div>
<div></div>
<div><div style="float: right;" id="checkoutfinal"><input type="button" onclick="if(chkvalidaion()){checkout_disable('checkout_final');}" value="Pedido: Paso final" class="greenbutton" name="checkout_final" id="checkout_final"><input type="hidden" value="checkoutfinal" name="task"><input type="hidden" value="checkout" name="view"><input type="hidden" value="com_redshop" name="option"><input type="hidden" value="1" id="onestepItemid" name="Itemid"><input type="hidden" value="3" name="users_info_id"><input type="hidden" value="" name="order_id"></div><input type="button" onclick="javascript:document.location='/component/redshop/1/?Itemid=1'" value="Continar" class="blackbutton"></div>
</td>
</tr>
</tbody>
</table></div><div style="display:none" id="divRedshopCartTemplateId">360</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div><div id="responceonestep" style="display:none"></div></form><script type="text/javascript">
function chkvalidaion() {
if (document.getElementById('termscondition')) {
var termscondition = document.getElementById('termscondition').checked;
if (!termscondition) {
alert("Por favor, seleccione los términos y condiciones como correctos.");
return false;
}
}
return true;
}
function checkout_disable(val) {
document.adminForm.submit();
document.getElementById(val).disabled = true;
var op = document.getElementById(val);
op.setAttribute("style", "opacity:0.3;");
if (op.style.setAttribute) //For IE
op.style.setAttribute("filter", "alpha(opacity=30);");
}
</script></div></section>
此代码显示 2 个“组”,但只需要显示 1 个:
Envios con Bordado
De 10 a 15 dias apartir de la autorización ($ 300 )
Envio Express de 3 a 5 dias apartir de la prueba de bordado ($ 500 )
Recojer en la tienda
Envios sin Bordado
De 5 a 15 Dias ($ 300 )
Express de 3 a 5 dias ($ 500 )
现在,我可以用来完成这项工作的代码如下:
<div class="cartattribut">
<div class="checkout_attribute_wrapper">
<div class="checkout_attribute_price">B. Frente Derecho</div>
</div>
<div class="checkout_attribute_wrapper">
<div class="checkout_attribute_price">C. Manga Derecha</div>
</div>
<div class="checkout_attribute_wrapper">
<div class="checkout_attribute_price">F. Espalda Alta</div>
</div>
</div>
<div class="cartaccessory"></div>
<div class="cartwrapper"></div>
<div class="cartuserfields"></div>
如果页面中存在 class="checkout_attribute_price" 则隐藏
Envios sin Bordado
[]De 5 a 15 Dias ($ 300 )
[]Express de 3 a 5 dias ($ 500 )
如果页面上不存在 class="checkout_attribute_price" 则隐藏
Envios con Bordado
[]De 10 a 15 dias apartir de la autorización ($ 300 )
[]Envio Express de 3 a 5 dias apartir de la prueba de bordado ($ 500 )
[]Recojer en la tienda
两个块的代码是:
<div id="divShippingRate"><fieldset>
<legend><strong>Métodos de envío</strong></legend>
<div>
<h3>Envios con Bordado</h3>
<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" checked="" value="Cs" name="shipping_rate_id" id="shipping_rate_id_10025_0"><label for="shipping_rate_id_10025_0">De 10 a 15 dias apartir de la autorización</label> ($ 300 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="ss" name="shipping_rate_id" id="shipping_rate_id_10025_1"><label for="shipping_rate_id_10025_1">Envio Express de 3 a 5 dias apartir de la prueba de bordado</label> ($ 500 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'default_shipping');" value="dd" name="shipping_rate_id" id="shipping_rate_id_10025_2"><label for="shipping_rate_id_10025_2">Recojer en la tienda</label></div>
</div>
<h3>Envios sin Bordado</h3>
<div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="ff" name="shipping_rate_id" id="shipping_rate_id_10040_0"><label for="shipping_rate_id_10040_0">De 5 a 15 Dias</label> ($ 300 )</div>
<div><input type="radio" onclick="javascript:onestepCheckoutProcess(this.name,'shipper');" value="gg" name="shipping_rate_id" id="shipping_rate_id_10040_1"><label for="shipping_rate_id_10040_1">Express de 3 a 5 dias</label> ($ 500 )</div>
</div>
</div>
</fieldset>
</div>
大约 3 个月前,我使用 PHP 完成了此操作并更改了此 CMS 的源代码,但随后必须进行更新,并且我丢失了所有更改……然后我又重新做了一遍……又一次更新。 ..所以这次我想在不更改cms源代码的情况下做到这一点...
正如我之前所说,我对 java 知之甚少,任何帮助将不胜感激。
谢谢你。