WordPress Ultra Simple Paypal Shopping Cart
Append text from input to product title? (1 post)

  1. PinkishHue
    Posted 3 years ago #

    Is it possible to append some data from a text input (or any kind of form input) to the product title?

    I have tried this (code below) but wherever I put $datepicked (my input) it will not add it to the title field. I'm not greatly experienced in PHP coding.

    /---- start code
    ' <input type="text" id="datepicker" name="datepicked" />
    <?php $datepicked = $_POST["datepicked"]; ?>

    <?php if( get_field( "price-adult" ) ): ?>
    <div class="ticketsection">
    <div class="tickettype">Adult <span>(over 13)</span> <span class="ticketprice">£<?php the_field( "price-adult" ); ?></span>
    <?php $priceadult = get_field( "price-adult" ); ?>
    <?php $name = get_the_title( '', ' (adult)' ); ?>
    <?php echo print_wp_cart_button_for_product($name, $priceadult); ?>

    <?php endif; ?>
    ----/ end code

    Thanks for any help anyone can suggest :)


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Ultra Simple Paypal Shopping Cart
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.