เเสดงตัวเลขเป็นตัวหนังสือค่ะ

พูดคุย phpBB3, SMF ปัญหา การติดตั้ง ปัญหา การลง Mod การแก้ไข หน้าตาบอร์ด การใช้งาน Joomla 1.5, 1.6, 1.7, 2.5 ,3.x รวมถึง Joomla 4 การใช้งาน wordpress และ CMS อื่นๆ
การตั้งคำถาม ควรระบุรุ่นที่ใช้ ในการตั้งคำตามด้วย นะ เช่น SMF 1.1.4 หรือ SMF2.0, OpenERP, Odoo และ รายละเอียดของ server OS, php เวอร์ชั่นไหน ฐานข้อมูลอะไร

Moderator: mindphp

กฎการใช้บอร์ด
คำถามหมวดนี้ ควรระบุ รายละเอียดของ Server OS, เวอร์ชั่น ของ PHP, CMS ที่ท่านใช้
รวมถึง Hosting หรือ Control Panel Hosting
or_neung
PHP Full Member
PHP Full Member
โพสต์: 47
ลงทะเบียนเมื่อ: 08/06/2009 2:02 pm

เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย or_neung »

ต่อจากของเก่าค่ะ
เเสดงใน virtuemart ได้เเล้ว
เเต่อยากให้เเสดงในส่วนของลูกค้าได้ด้วย
คล้ายๆ กับของเก่าค่ะ
เเต่ไม่รู้ว่าต้องเเก้ตรงไหน
รบกวนช่วยอีกทีนะค่ะ

โค้ด: เลือกทั้งหมด

	function show_price( $product_id, $hide_tax = false ) {
		global $VM_LANG, $CURRENCY_DISPLAY,$vendor_mail;
		$auth = $_SESSION['auth'];

		$product_name = htmlentities( $this->get_field($product_id, 'product_name'), ENT_QUOTES );
		$no_price_html = "&nbsp;<a href=\"mailto:$vendor_mail?subject=".$VM_LANG->_PHPSHOP_PRODUCT_CALL.": $product_name\">".$VM_LANG->_PHPSHOP_PRODUCT_CALL."</a>";

		if( $auth['show_prices'] ) {
			// Get the DISCOUNT AMOUNT
			$discount_info = $this->get_discount( $product_id );

			// Get the Price according to the quantity in the Cart
			$price_info = $this->get_price( $product_id );
			// Get the Base Price of the Product
			$base_price_info = $this->get_price($product_id, true );
			if( $price_info === false ) {
				$price_info = $base_price_info;
			}
			$html = "";
			$undiscounted_price = 0;
			if (isset($price_info["product_price_id"])) {

				$base_price = $base_price_info["product_price"];
				$price = $price_info["product_price"];

				if ($auth["show_price_including_tax"] == 1) {
					$my_taxrate = $this->get_product_taxrate($product_id);
					$base_price += ($my_taxrate * $base_price);
				}
				else {
					$my_taxrate = 0;
				}
				// Calculate discount
				if( !empty($discount_info["amount"])) {
					$undiscounted_price = $base_price;
					switch( $discount_info["is_percent"] ) {
						case 0: $base_price -= $discount_info["amount"]; break;
						case 1: $base_price *= (100 - $discount_info["amount"])/100; break;
					}
				}
				$text_including_tax = "";
				if (!empty($my_taxrate)) {
					$tax = $my_taxrate * 100;
					// only show "including x % tax" when it shall
					// not be hidden
					if( !$hide_tax && $auth["show_price_including_tax"] == 1 && VM_PRICE_SHOW_INCLUDINGTAX) {
						$text_including_tax = $VM_LANG->_PHPSHOP_INCLUDING_TAX;
						eval ("\$text_including_tax = \"$text_including_tax\";");

					}
				}
				if(!empty($discount_info["amount"])) {
					$html .= "<span style=\"color:red;\">\n<strike>";
					$html .= $CURRENCY_DISPLAY->getFullValue($undiscounted_price);
					$html .= "</strike> $text_including_tax</span>\n<br/>";
				}

				$html .= "<span style=\"font-weight:bold\">\n";
				$html .= $CURRENCY_DISPLAY->getFullValue($base_price);
				$html .= "</span>\n ";

				$html .= $text_including_tax;

				if(!empty($discount_info["amount"])) {
					$html .= "<br />";
					$html .= $VM_LANG->_PHPSHOP_PRODUCT_DISCOUNT_SAVE.": ";
					if($discount_info["is_percent"]==1)
					$html .= $discount_info["amount"]."%";
					else
					$html .= $CURRENCY_DISPLAY->getFullValue($discount_info["amount"]);
				}

				// Check if we need to display a Table with all Quantity <=> Price Relationships
				if( $base_price_info["product_has_multiple_prices"] && !$hide_tax ) {
					$db = new ps_DB;
					// Quantity Discount Table
					$q = "SELECT product_price, price_quantity_start, price_quantity_end FROM #__{vm}_product_price
				  WHERE product_id='$product_id' AND shopper_group_id='".$auth["shopper_group_id"]."' ORDER BY price_quantity_start";
					$db->query( $q );

					//         $prices_table = "<table align=\"right\">
					$prices_table = "<table width=\"100%\">
					  <thead><tr class=\"sectiontableheader\">
					  <th>".$VM_LANG->_PHPSHOP_CART_QUANTITY."</th>
					  <th>".$VM_LANG->_PHPSHOP_CART_PRICE."</th>
					  </tr></thead>
					  <tbody>";
					$i = 1;
					while( $db->next_record() ) {

						$prices_table .= "<tr class=\"sectiontableentry$i\"><td>".$db->f("price_quantity_start")." - ".$db->f("price_quantity_end")."</td>";
						$prices_table .= "<td>";
						if (!empty($my_taxrate))
						$prices_table .= $CURRENCY_DISPLAY->getFullValue( ($my_taxrate+1)*$db->f("product_price") );
						else
						$prices_table .= $CURRENCY_DISPLAY->getFullValue( $db->f("product_price") );
						$prices_table .= "</td></tr>";
						$i == 1 ? $i++ : $i--;
					}
					$prices_table .= "</tbody></table>";
					if( @$_REQUEST['page'] == "shop.browse" ) {
						$html .= mm_ToolTip( $prices_table );
					}
					else
					$html .= $prices_table;
				}
			}
			// No price, so display "Call for pricing"
			else {
				$html = $no_price_html;
			}
			return $html;
		}
		else
		return $no_price_html;
	}
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41410
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

:?: :?:
แสดงอะไร มีภาพประกอบคำถามไหมครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
or_neung
PHP Full Member
PHP Full Member
โพสต์: 47
ลงทะเบียนเมื่อ: 08/06/2009 2:02 pm

Re: เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย or_neung »

คือแก้ไขในส่วน Virtuemart เเล้ว เป็น 7xxx
เเต่พอมาดูในส่วนของลูกค้าที่เเสดงราคาสินค้า
มันยังเเสดงเป็น 7 บาทอยู่เลยค่ะ
ไม่ทราบว่าเเก้ยังไง
รบกวนช่วยหน่อยนะคะ
แนบไฟล์
123.JPG
123.JPG (18.67 KiB) Viewed 2765 times
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41410
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ถ้าไม่ต้องการค่าอื่น ให้ comment ค่าที่ไม่ต้องการออกครับ
ตรงนั้นมะจะเอามา คิดคำนวนพวก รายละเีอียด ของราคา
เอาแค่
ตำแหน่ง

โค้ด: เลือกทั้งหมด

$CURRENCY_DISPLAY->getFullValue($undiscounted_price)
เปลี่ยนเป็นค่าที่ได้จากฐานข้อมูลไปเลยครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
or_neung
PHP Full Member
PHP Full Member
โพสต์: 47
ลงทะเบียนเมื่อ: 08/06/2009 2:02 pm

Re: เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย or_neung »

ลองดูเเล้วค่ะ
เเต่ทำไม่ได้
เเสดงผลเหมือนเดิมเลย
มีวิธีอื่นอีกไหมค่ะ
or_neung
PHP Full Member
PHP Full Member
โพสต์: 47
ลงทะเบียนเมื่อ: 08/06/2009 2:02 pm

Re: เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย or_neung »

ตอนนี้ไม่มีใครสามารถช่วยเค้าได้เเล้วเหรอ :( :? :(
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41410
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: เเสดงตัวเลขเป็นตัวหนังสือค่ะ

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

มีปัญหาอะไร อยู่ครับ
ทำอะไรไปบ้างแล้วครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ตอบกลับโพส

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Bing [Bot] และบุคลทั่วไป 92